remove small teapot without normals
This commit is contained in:
parent
f85681a44e
commit
89cb1d7962
12829
public/objs/teapot.obj
12829
public/objs/teapot.obj
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -21,7 +21,7 @@ export function changeFragmentShader(gl: any,
|
||||||
[shaderProgram, fragmentShader] = initShaderProgram(gl,
|
[shaderProgram, fragmentShader] = initShaderProgram(gl,
|
||||||
vsSource,
|
vsSource,
|
||||||
fsSource)!;
|
fsSource)!;
|
||||||
const programInfo = {
|
const programInfo: any = {
|
||||||
program: shaderProgram,
|
program: shaderProgram,
|
||||||
attribLocations: {
|
attribLocations: {
|
||||||
vertexPosition: gl.getAttribLocation(shaderProgram,
|
vertexPosition: gl.getAttribLocation(shaderProgram,
|
||||||
|
|
|
@ -144,7 +144,7 @@ async function main() {
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
const data = await getObj('/static/objs/teapot_normals.obj');
|
const data = await getObj('/static/objs/teapot.obj');
|
||||||
let distance: any = $('#input1').val();
|
let distance: any = $('#input1').val();
|
||||||
distance = parseFloat(distance);
|
distance = parseFloat(distance);
|
||||||
const [
|
const [
|
||||||
|
@ -235,19 +235,6 @@ async function main() {
|
||||||
deleteBuffers(gl, buffers);
|
deleteBuffers(gl, buffers);
|
||||||
buffers = initBuffers(gl, positions, indices, normals);
|
buffers = initBuffers(gl, positions, indices, normals);
|
||||||
});
|
});
|
||||||
$('#teapot_normals').on('click', async function() {
|
|
||||||
const data = await getObj('/static/objs/teapot_normals.obj');
|
|
||||||
const [
|
|
||||||
positions,
|
|
||||||
normals,
|
|
||||||
uvs,
|
|
||||||
indices,
|
|
||||||
] = convert(data);
|
|
||||||
console.log(uvs);
|
|
||||||
length = indices.length;
|
|
||||||
deleteBuffers(gl, buffers);
|
|
||||||
buffers = initBuffers(gl, positions, indices, normals);
|
|
||||||
});
|
|
||||||
$('#teapot').on('click', async function() {
|
$('#teapot').on('click', async function() {
|
||||||
const data = await getObj('/static/objs/teapot.obj');
|
const data = await getObj('/static/objs/teapot.obj');
|
||||||
const [
|
const [
|
||||||
|
@ -356,8 +343,7 @@ function drawScene(gl: any,
|
||||||
programInfo.attribLocations.vertexPosition);
|
programInfo.attribLocations.vertexPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tell WebGL how to pull out the positions from the position
|
|
||||||
// buffer into the vertexPosition attribute.
|
|
||||||
{
|
{
|
||||||
const numComponents = 3;
|
const numComponents = 3;
|
||||||
const type = gl.FLOAT;
|
const type = gl.FLOAT;
|
||||||
|
|
|
@ -25,7 +25,6 @@
|
||||||
</div>
|
</div>
|
||||||
<div class='ui-block'>
|
<div class='ui-block'>
|
||||||
<button id='sphere'>Set obj to sphere</button>
|
<button id='sphere'>Set obj to sphere</button>
|
||||||
<button id='teapot_normals'>Set obj to teapot with normals</button>
|
|
||||||
<button id='teapot'>Set obj to teapot</button>
|
<button id='teapot'>Set obj to teapot</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue