You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+33-30Lines changed: 33 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -82,57 +82,60 @@ More? [#three.js on irc.freenode.net](http://webchat.freenode.net/?channels=thre
82
82
83
83
Download the [minified library](http://mrdoob.github.com/three.js/build/Three.js) and include it in your html.
84
84
85
-
<script src="js/Three.js"></script>
85
+
```html
86
+
<scriptsrc="js/Three.js"></script>
87
+
```
86
88
87
89
This code creates a camera, then creates a scene, adds a cube on it, creates a <canvas> renderer and adds its viewport in the document.body element.
88
90
89
-
<script>
91
+
```html
92
+
<script>
90
93
91
-
var camera, scene, renderer,
92
-
geometry, material, mesh;
94
+
var camera, scene, renderer,
95
+
geometry, material, mesh;
93
96
94
-
init();
95
-
animate();
97
+
init();
98
+
animate();
96
99
97
-
function init() {
100
+
functioninit() {
98
101
99
-
camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 1, 10000 );
100
-
camera.position.z = 1000;
102
+
camera =newTHREE.PerspectiveCamera( 75, window.innerWidth/window.innerHeight, 1, 10000 );
103
+
camera.position.z=1000;
101
104
102
-
scene = new THREE.Scene();
105
+
scene =newTHREE.Scene();
103
106
104
-
geometry = new THREE.CubeGeometry( 200, 200, 200 );
105
-
material = new THREE.MeshBasicMaterial( { color: 0xff0000, wireframe: true } );
107
+
geometry =newTHREE.CubeGeometry( 200, 200, 200 );
108
+
material =newTHREE.MeshBasicMaterial( { color:0xff0000, wireframe:true } );
0 commit comments