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