Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var s = new THREE.SplineCurve3([
- new THREE.Vector3(0, 0, 0),
- new THREE.Vector3(100, 10, 20),
- new THREE.Vector3(200, 0, 220),
- new THREE.Vector3(400, 10, 60),
- ]);
- var extrudeSettings = { amount: 100, steps: 40, material: 0, extrudeMaterial: 0 , extrudePath : s };
- var colorMaterials = [ new THREE.MeshPhongMaterial( { color: 0xff5500, shininess: 100 } ), new THREE.MeshPhongMaterial( { color: 0xff0000, shininess: 100 } ) ];
- var imageAndColorMaterials = [ texturedMaterial, new THREE.MeshPhongMaterial( { color: 0x00aaff, shininess: 100 } ) ];
- var shape1 = new THREE.Shape();
- shape1.moveTo( 0, 0 );
- shape1.lineTo( 10, 0 );
- shape1.lineTo( 10, 3 );
- shape1.lineTo( 9, 4 );
- shape1.lineTo( 5, 4 );
- shape1.lineTo( 5, 5 );
- shape1.lineTo( 4, 5 );
- shape1.lineTo( 4, 4 );
- shape1.lineTo( 0, 4 );
- shape1.lineTo( -4, 4 );
- shape1.lineTo( -4, 5 );
- shape1.lineTo( -5, 5 );
- shape1.lineTo( -5, 4 );
- shape1.lineTo( -9, 4 );
- shape1.lineTo( -10, 3 );
- shape1.lineTo( -10, 0 );
- var Geometry1 = shape1.extrude( extrudeSettings );
- Geometry1.materials = colorMaterials;
- Geometry1.computeVertexNormals();
- THREE.GeometryUtils.center( Geometry1 );
- var Mesh1 = new THREE.Mesh( Geometry1, new THREE.MeshFaceMaterial() );
- Mesh1.position.z = 1000;
- Mesh1.position.y = -100;
- parent.add ( Mesh1 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement