₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,328,952 members, 8,438,100 topics. Date: Thursday, 02 July 2026 at 10:13 PM

Toggle theme

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

Nairaland ForumScience/TechnologyProgramming3D Games With Javascript 3D Library - Three.js (967 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 NowBuilding A Word Scramble Game With Javascript (text Based)How To Get A User IP Address With Javascript234

Reviews On Top Four Social Media NetworkJava/.net Developers Urgently Needed @ A MultinationWhere To Get Premium Ict, Digital Media And Creative Designs Training