Three.js立方体
作者:互联网
平面和缓冲平面:
var geometry = new Three.PlaneBufferGeometry( 10, 10, 1,1 ); var material = new Three.MeshBasicMaterial( { color: 0xffff00 } ); var mesh= new Three.Mesh( geometry, material ); this.scene.add( mesh); var geometry = new Three.PlaneGeometry( 10, 10, 1,1 ); var material = new Three.MeshBasicMaterial( { color: 0xffff00 } ); var mesh= new Three.Mesh( geometry, material ); this.scene.add( mesh);
球体和缓冲球体
var geometry = new Three.SphereGeometry(1.6,40,40); var material = new Three.MeshLambertMaterial({ color:0x0000FF, wireframe:false}); this.mesh = new Three.Mesh( geometry, material ); this.mesh.position.set(0,0,0) this.scene.add( this.mesh ); var geometry = new Three.SphereBufferGeometry(1.6,40,40); var material = new Three.MeshLambertMaterial({ color:0x0000FF, wireframe:false}); this.mesh = new Three.Mesh( geometry, material ); this.mesh.position.set(0,0,0) this.scene.add( this.mesh );
立方体和缓冲立方体:
var geometry = new Three.BoxGeometry( 1, 1, 1 ); var material = new Three.MeshBasicMaterial( {color: 0x00ff00} ); var cube = new Three.Mesh( geometry, material ); this.scene.add(cube)
var geometry = new Three.BoxBufferGeometry( 1, 1, 1 ); var material = new Three.MeshBasicMaterial( {color: 0x00ff00} ); var cube = new Three.Mesh( geometry, material ); this.scene.add(cube)
圆形几何体和圆形缓冲几何体:
var geometry = new Three.CircleGeometry( 5, 32 ); var material = new Three.MeshBasicMaterial( { color: 0xffff00 } ); var circle = new Three.Mesh( geometry, material ); this.scene.add( circle );
var geometry = new Three.CircleBufferGeometry( 5, 32 ); var material = new Three.MeshBasicMaterial( { color: 0xffff00 } ); var circle = new Three.Mesh( geometry, material ); this.scene.add( circle );
圆锥几何体和圆锥缓冲几何体:
var geometry = new Three.ConeGeometry( 5, 32 ); var material = new Three.MeshBasicMaterial( { color: 0xffff00 } ); var cone= new Three.Mesh( geometry, material ); this.scene.add( cone);
var geometry = new Three.ConeBufferGeometry( 5, 32 ); var material = new Three.MeshBasicMaterial( { color: 0xffff00 } ); var cone= new Three.Mesh( geometry, material ); this.scene.add( cone);
圆柱和圆柱缓冲几何体:
var geometry = new Three.CylinderGeometry(5, 5, 20, 32); var material = new Three.MeshBasicMaterial( { color: 0xffff00 } ); var cylinder= new Three.Mesh( geometry, material ); this.scene.add( cylinder)
var geometry = new Three.CylinderBufferGeometry(5, 5, 20, 32); var material = new Three.MeshBasicMaterial( { color: 0xffff00 } ); var cylinder= new Three.Mesh( geometry, material ); this.scene.add( cylinder)
十二面几何体和缓冲十二面几何体
var geometry = new Three.DodecahedronBufferGeometry(5, 5, 20, 32);
var material = new Three.MeshBasicMaterial( { color: 0xffff00 } );
var mesh= new Three.Mesh( geometry, material );
this.scene.add( mesh)
var geometry = new Three.DodecahedronBufferGeometry(5, 5, 20, 32);
var material = new Three.MeshBasicMaterial( { color: 0xffff00 } );
var mesh= new Three.Mesh( geometry, material );
this.scene.add( mesh)
标签:geometry,material,Three,js,var,立方体,new,color 来源: https://www.cnblogs.com/-llf/p/14777841.html