-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLevelData.js
More file actions
26 lines (21 loc) · 928 Bytes
/
LevelData.js
File metadata and controls
26 lines (21 loc) · 928 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// JavaScript source code
// Now create an array of positions for the square.
const LevelData = (function () {
const mat4 = glMatrix.mat4;
var objects = [];
objects.push(Primitives.instantiate(Primitives.shapes["cube"], 0));
objects.push(Primitives.instantiate(Primitives.shapes["cube"], 1));
mat4.translate(objects[0].matrix, // destination matrix
objects[0].matrix, // matrix to translate
[-3.5, 0.0, 0.0]);
mat4.rotate(objects[0].matrix, // destination matrix
objects[0].matrix, // matrix to rotate
.7, // amount to rotate in radians
[0, 1, 0]);
var obj2 = Primitives.instantiate(Primitives.shapes["cube"], 2)
mat4.translate(obj2.matrix, // destination matrix
obj2.matrix, // matrix to translate
[3.5, 0.0, 0.0]);
setTimeout(function () { objects.push(obj2) }, 4000);
return { 'objects': objects };
})();