Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,194,142 members, 7,953,523 topics. Date: Thursday, 19 September 2024 at 05:56 PM

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

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

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)

(1) (Reply) (Go Down)

3D Games With Javascript 3D Library - Three.js by Nobody: 2:50pm On May 08, 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

(1) (Reply)

Help Out With Algorithm To Add Multiple Numbers / most Downloaded Nigerian Android Application by Nigerians / Facebook Ranks Nigeria And Kenya As Top Active Mobile Users In Africa

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 8
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.