₦airaland Forum

Welcome, Guest: Register • Login • With Google • Trending • Recent • New

Stats: 3,347,667 members, 8,528,741 topics. Date: Wednesday, 02 December 2026 at 07:33 PM

Toggle theme

3D Games With Javascript 3D Library - Three.js - Programming - Nairaland

Nairaland Forum › Science/Technology › Programming › 3D Games With Javascript 3D Library - Three.js (987 Views)

1 Reply (Go Down)

3D Games With Javascript 3D Library - Three.js by Nobody:
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
1 Reply

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

Check My Tv App That i Develop Using My Android Phone • i need a computer programmer in calabar for tutorial at reasonable price • Web Development And App Development Promo !