Code: Turning Our Avatar

This is the code from Chapter 8, Project: Turning Our Avatar.

 
<body>​</body>
 
<script src="http://gamingJS.com/Three.js​"></script>
 
<script src="​http:​//gamingJS.com/Tween.js"></script>
 
<script src="http://gamingJS.com/ChromeFixes.js">​</script>
 
<body></body><script>
 
// This is where stuff in our game will happen:
 
var​ scene = ​new​ THREE.Scene();
 
 
// This is what sees the stuff:
 
var​ aspect_ratio = window.innerWidth / window.innerHeight;
 
var​ camera = ​new​ THREE.PerspectiveCamera(75, aspect_ratio, 1, 10000);
 
camera.position.z = 500;
 
//scene.add(camera);
 
 
// This will draw what the camera sees onto the screen:
 
var​ renderer = ​new​ THREE.CanvasRenderer();
 
renderer.setSize(window.innerWidth, ...

Get 3D Game Programming for Kids now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.