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,
|
||||
vsSource,
|
||||
fsSource)!;
|
||||
const programInfo = {
|
||||
const programInfo: any = {
|
||||
program: shaderProgram,
|
||||
attribLocations: {
|
||||
vertexPosition: gl.getAttribLocation(shaderProgram,
|
||||
|
|
|
@ -144,7 +144,7 @@ async function main() {
|
|||
return data;
|
||||
}
|
||||
|
||||
const data = await getObj('/static/objs/teapot_normals.obj');
|
||||
const data = await getObj('/static/objs/teapot.obj');
|
||||
let distance: any = $('#input1').val();
|
||||
distance = parseFloat(distance);
|
||||
const [
|
||||
|
@ -235,19 +235,6 @@ async function main() {
|
|||
deleteBuffers(gl, buffers);
|
||||
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() {
|
||||
const data = await getObj('/static/objs/teapot.obj');
|
||||
const [
|
||||
|
@ -356,8 +343,7 @@ function drawScene(gl: any,
|
|||
programInfo.attribLocations.vertexPosition);
|
||||
}
|
||||
|
||||
// Tell WebGL how to pull out the positions from the position
|
||||
// buffer into the vertexPosition attribute.
|
||||
|
||||
{
|
||||
const numComponents = 3;
|
||||
const type = gl.FLOAT;
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
</div>
|
||||
<div class='ui-block'>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue