Capítulo 51 de 859
Tessellates the famous Utah teapot database by Martin Newell into triangles.
The teapot should normally be rendered as a double sided object, since for some patches both sides can be seen, e.g., the gap around the lid and inside the spout.
Segments 'n' determines the number of triangles output. Total triangles = 32_2_n_n - 8_n (degenerates at the top and bottom cusps are deleted).
Code based on SPD software Created for the Udacity course Interactive Rendering
const geometry = new TeapotGeometry( 50, 18 );
const material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
const teapot = new THREE.Mesh( geometry, material );
scene.add( teapot );
Constructor
| Signature |
|---|
new TeapotGeometry( size : number, segments : number, bottom : boolean, lid : boolean, body : boolean, fitLid : boolean, blinn : boolean ) |