remove small teapot without normals

This commit is contained in:
gbrochar 2020-11-24 15:05:35 +01:00
parent f85681a44e
commit 89cb1d7962
5 changed files with 2868 additions and 12848 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -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,

View File

@ -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;

View File

@ -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>