提交 c7ff082b 编写于 作者: R Ricardo Cabello

Merge pull request #6453 from WestLangley/dev-shapes

Added example of ShapeGeometry with texture
......@@ -64,11 +64,26 @@
group.position.y = 50;
scene.add( group );
var texture = THREE.ImageUtils.loadTexture( "textures/UV_Grid_Sm.jpg" );
texture.wrapS = texture.wrapT = THREE.RepeatWrapping;
texture.repeat.set( 0.008, 0.008 );
function addShape( shape, extrudeSettings, color, x, y, z, rx, ry, rz, s ) {
var points = shape.createPointsGeometry();
var spacedPoints = shape.createSpacedPointsGeometry( 50 );
// flat shape with texture
// note: default UVs generated by ShapeGemoetry are simply the x- and y-coordinates of the vertices
var geometry = new THREE.ShapeGeometry( shape );
var mesh = new THREE.Mesh( geometry, new THREE.MeshPhongMaterial( { side: THREE.DoubleSide, map: texture } ) );
mesh.position.set( x, y, z - 175 );
mesh.rotation.set( rx, ry, rz );
mesh.scale.set( s, s, s );
group.add( mesh );
// flat shape
var geometry = new THREE.ShapeGeometry( shape );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册