daily pastebin goal
85%
SHARE
TWEET

Görüşürüz!

a guest Feb 17th, 2019 110 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var camera, scene, renderer;
  2. var geometry, material, mesh;
  3. init();
  4. animate();
  5. function init() {
  6. camera = new THREE.PerspectiveCamera( 75, window.innerWidth
  7. / window.innerHeight, 1, 1000 );
  8. camera.position.z = 500;
  9. scene = new THREE.Scene();
  10. geometry = new THREE.IcosahedronGeometry( 200, 1 );
  11. material = new THREE.MeshBasicMaterial( { color: 0x000000,
  12. wireframe: true, wireframeLinewidth: 2 } );
  13. mesh = new THREE.Mesh( geometry, material );
  14. scene.add( mesh );
  15. renderer = new THREE.CanvasRenderer();
  16. renderer.setSize( window.innerWidth, window.innerHeight );
  17. document.body.appendChild( renderer.domElement );
  18. }
  19. function animate() {
  20. requestAnimationFrame( animate );
  21. mesh.rotation.x = Date.now() * 0.00005;
  22. mesh.rotation.y = Date.now() * 0.0001;
  23. renderer.render( scene, camera );
  24.  
  25. --------------------------
  26. --------------------------
  27. Cube
  28.  
  29. THREE.CubeGeometry(width, height,
  30. depth, widthSegments = 1,
  31. heightSegments = 1,
  32. depthSegments = 1)
  33. ---------------------------
  34. Sphere
  35.  
  36. THREE.Sphere(radius,
  37. horizontalSegments = 8,
  38. verticalSegments = 6)
  39. ---------------------------
  40. Polyhedra
  41.  
  42. (spheroids) THREE.Icosahedron(radius, detail
  43. = 0);
  44. THREE.Octahedron(radius, detail =
  45. 0);
  46. THREE.Tetrahedron(radius, detail
  47. = 0);
  48. ---------------------------
  49. Cylinder
  50.  
  51. THREE.CylinderGeometry(radiusTop,
  52. radiusBottom, height,
  53. radiusSegments = 8,
  54. heightSegments = 1, openEnded =
  55. false)
  56. ---------------------------
  57. Torus
  58.  
  59. THREE.TorusGeometry(radius,
  60. tubeWidth = 40, radialSegments =
  61. 8, tubularSegments = 6)
  62. ---------------------------
  63. TorusKnot
  64.  
  65. THREE.TorusKnotGeometry(radius,
  66. tubeWidth = 40, radialSegments,
  67. tubularSegments, p = 2, q = 3,
  68. heightScale = 1)
  69. ----------------------------
  70. ----------------------------
  71. Plane
  72.  
  73. THREE.PlaneGeometry(width,
  74. height, widthSegments = 1,
  75. heightSegments = 1)
  76. ----------------------------
  77. Circle
  78.  
  79. THREE.CircleGeometry(radius,
  80. numberOfSides = 8)
  81. ---------------------------
  82. Ring
  83.  
  84. THREE.RingGeometry(innerRadius,
  85. outerRadius, radialSegments = 8, ringSegments = 8)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top