3D Games With Javascript 3D Library - Three.js - Programming - Nairaland
Nairaland Forum › Science/Technology › Programming › 3D Games With Javascript 3D Library - Three.js (967 Views)
| 3D Games With Javascript 3D Library - Three.js by Nobody: 2:50pm On May 08, 2015*. Modified: 9:53pm On May 09, 2015 |
Are there any three.js programmers in the house. I'm interested in mastering this Javascript 3D library for games and other stuff it can be used for. In few seconds I was able to create this animated 3D cude image in a web browser with the sample JavaScript code in their documentation. Here is their web address for those interested in this Javascript 3D library: http://threejs.org While a simple cube in raw WebGL would turn out hundreds of lines of Javascript and shader code, a Three.js equivalent is only a fraction of that. <html> <head> <title>My first Three.js app</title> <style> body { margin: 0; } canvas { width: 100%; height: 100% } </style> </head> <body> <script src="js/three.min.js"></script> <script> var scene = new THREE.Scene(); var camera = new THREE.PerspectiveCamera( 75, window.innerWidth/window.innerHeight, 0.1, 1000 ); var renderer = new THREE.WebGLRenderer(); renderer.setSize( window.innerWidth, window.innerHeight ); document.body.appendChild( renderer.domElement ); var geometry = new THREE.BoxGeometry( 1, 1, 1 ); var material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } ); var cube = new THREE.Mesh( geometry, material ); scene.add( cube ); camera.position.z = 5; var render = function () { requestAnimationFrame( render ); cube.rotation.x += 0.1; cube.rotation.y += 0.1; renderer.render(scene, camera); }; render(); </script> </body> </html>
|
| Re: 3D Games With Javascript 3D Library - Three.js by W3irDo: 8:58pm On May 09, 2015 |
. |
| Re: 3D Games With Javascript 3D Library - Three.js by Tapiyo(m): 11:11pm On May 10, 2015 |
You r too much |
| Re: 3D Games With Javascript 3D Library - Three.js by SuccX(m): 4:33pm On May 11, 2015 |
if u are good on Autocad and can work fast.emaill: successola11@yahoo.com 4 a quick job on architectural design |
Learn How To Creat 3D Games Online Now • Building A Word Scramble Game With Javascript (text Based) • How To Get A User IP Address With Javascript • 2 • 3 • 4
Reviews On Top Four Social Media Network • Java/.net Developers Urgently Needed @ A Multination • Where To Get Premium Ict, Digital Media And Creative Designs Training