Advertisement
Guest User

Untitled

a guest
Mar 19th, 2012
590
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var s = new THREE.SplineCurve3([
  2.     new THREE.Vector3(0, 0, 0),
  3.     new THREE.Vector3(100, 10, 20),
  4.     new THREE.Vector3(200, 0, 220),
  5.     new THREE.Vector3(400, 10, 60),
  6.    
  7.      ]);
  8.  
  9. var extrudeSettings = { amount: 100, steps: 40, material: 0, extrudeMaterial: 0 , extrudePath : s };
  10.  
  11. var colorMaterials = [ new THREE.MeshPhongMaterial( { color: 0xff5500, shininess: 100 } ), new THREE.MeshPhongMaterial( { color: 0xff0000, shininess: 100 } ) ];
  12. var imageAndColorMaterials = [ texturedMaterial, new THREE.MeshPhongMaterial( { color: 0x00aaff, shininess: 100 } ) ];
  13.  
  14. var shape1 = new THREE.Shape();
  15. shape1.moveTo( 0, 0 );
  16. shape1.lineTo( 10, 0 );
  17. shape1.lineTo( 10, 3 );
  18. shape1.lineTo( 9, 4 );
  19.  
  20. shape1.lineTo( 5, 4 );
  21. shape1.lineTo( 5, 5 );
  22. shape1.lineTo( 4, 5 );
  23. shape1.lineTo( 4, 4 );
  24. shape1.lineTo( 0, 4 );
  25.  
  26. shape1.lineTo( -4, 4 );
  27. shape1.lineTo( -4, 5 );
  28. shape1.lineTo( -5, 5 );
  29. shape1.lineTo( -5, 4 );
  30. shape1.lineTo( -9, 4 );
  31. shape1.lineTo( -10, 3 );
  32. shape1.lineTo( -10, 0 );
  33.  
  34. var Geometry1 = shape1.extrude( extrudeSettings );
  35.  
  36. Geometry1.materials = colorMaterials;
  37. Geometry1.computeVertexNormals();
  38.  
  39. THREE.GeometryUtils.center( Geometry1 );
  40.  
  41. var Mesh1 = new THREE.Mesh( Geometry1, new THREE.MeshFaceMaterial() );
  42.  
  43. Mesh1.position.z = 1000;
  44. Mesh1.position.y = -100;
  45.  
  46. parent.add ( Mesh1 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement