Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var camera, scene, renderer;
- var geometry, material, mesh;
- init();
- animate();
- function init() {
- camera = new THREE.PerspectiveCamera( 75, window.innerWidth
- / window.innerHeight, 1, 1000 );
- camera.position.z = 500;
- scene = new THREE.Scene();
- geometry = new THREE.IcosahedronGeometry( 200, 1 );
- material = new THREE.MeshBasicMaterial( { color: 0x000000,
- wireframe: true, wireframeLinewidth: 2 } );
- mesh = new THREE.Mesh( geometry, material );
- scene.add( mesh );
- renderer = new THREE.CanvasRenderer();
- renderer.setSize( window.innerWidth, window.innerHeight );
- document.body.appendChild( renderer.domElement );
- }
- function animate() {
- requestAnimationFrame( animate );
- mesh.rotation.x = Date.now() * 0.00005;
- mesh.rotation.y = Date.now() * 0.0001;
- renderer.render( scene, camera );
- --------------------------
- --------------------------
- Cube
- THREE.CubeGeometry(width, height,
- depth, widthSegments = 1,
- heightSegments = 1,
- depthSegments = 1)
- ---------------------------
- Sphere
- THREE.Sphere(radius,
- horizontalSegments = 8,
- verticalSegments = 6)
- ---------------------------
- Polyhedra
- (spheroids) THREE.Icosahedron(radius, detail
- = 0);
- THREE.Octahedron(radius, detail =
- 0);
- THREE.Tetrahedron(radius, detail
- = 0);
- ---------------------------
- Cylinder
- THREE.CylinderGeometry(radiusTop,
- radiusBottom, height,
- radiusSegments = 8,
- heightSegments = 1, openEnded =
- false)
- ---------------------------
- Torus
- THREE.TorusGeometry(radius,
- tubeWidth = 40, radialSegments =
- 8, tubularSegments = 6)
- ---------------------------
- TorusKnot
- THREE.TorusKnotGeometry(radius,
- tubeWidth = 40, radialSegments,
- tubularSegments, p = 2, q = 3,
- heightScale = 1)
- ----------------------------
- ----------------------------
- Plane
- THREE.PlaneGeometry(width,
- height, widthSegments = 1,
- heightSegments = 1)
- ----------------------------
- Circle
- THREE.CircleGeometry(radius,
- numberOfSides = 8)
- ---------------------------
- Ring
- THREE.RingGeometry(innerRadius,
- outerRadius, radialSegments = 8, ringSegments = 8)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement