Threejs cylinder

function init() { scene = new THREE.Scene(); camera = new THREE.PerspectiveCamera(50, window.innerWidth / window.innerHeight, 1, 10000); camera.position.z = 250; // The less the value the bigger the objects will look scene.add(camera); var p1 = new THREE.PlaneGeometry(80, 40); var c1 = new THREE.CylinderGeometry(750, 750, 500, 100, 100, true); var texture = THREE.ImageUtils.loadTexture('images/McamRImage_0493816072-20028-1.png'); //texture.needsUpdate = true; material = new THREE.MeshBasicMaterial({ map: texture }) //mesh = new THREE.Mesh(c1, material); mesh = new THREE.Mesh(p1, material); scene.add(mesh); // Step 4 : Add Renderer renderer = new THREE.WebGLRenderer(canvas1); renderer.setSize(window.innerWidth, window.innerHeight); document.body.appendChild(renderer.domElement); } function animate() { requestAnimationFrame(animate); render(); } function render() { //mesh.rotation.x += 0.05; renderer.render(scene, camera); }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.