Graphics Reference
In-Depth Information
function init() {
// create a scene, that will hold
all our elements
// such as objects, cameras and
lights.
scene = new THREE.Scene();
// create a camera, which defines
where we looking at.
camera = new
THREE.PerspectiveCamera(45,
window.innerWidth / window.innerHeight,
0.1, 1000);
// position and point the camera to
the center
camera.position.x = 15;
camera.position.y = 16;
camera.position.z = 13;
camera.lookAt(scene.position);
// create a renderer, set the
background color and size
renderer = new
THREE.WebGLRenderer();
renderer.setClearColor(0x000000,
1.0);
renderer.setSize(window.innerWidth,
window.innerHeight);
// create a cube and add to scene
var cubeGeometry = new
THREE.BoxGeometry(10 * Math.random(), 10
* Math.random(), 10 * Math.random());
var cubeMaterial = new
THREE.MeshNormalMaterial();
var cube = new
Search WWH ::




Custom Search