-
Notifications
You must be signed in to change notification settings - Fork 0
/
notMyThree.js
93 lines (65 loc) · 2.09 KB
/
notMyThree.js
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
function loc() {
var geometry = new THREE.Geometry();
var home = new THREE.Vector3(0, 0, 0);
var p1 = new THREE.Vector3(0 - 0.080829, 0 - 0.0571548, 0 - 0.14);
var p2 = new THREE.Vector3(0 - 0.080829, 0 - 0.0571548, 0.28 - 0.14);
var p3 = new THREE.Vector3(0.242487 - 0.080829, 0 - 0.0571548, 0.14 - 0.14);
var p4 = new THREE.Vector3(0.080829 - 0.080829, 0.228619 - 0.0571548, 0.14 - 0.14);
geometry.vertices.push(
home,
p1,
home,
p2,
home,
p3,
home,
p4,
home,
new THREE.Vector3(0, -.5, 0)
);
return geometry;
}
function cube(size) {
var h = size * .5;
var geometry = new THREE.Geometry();
geometry.vertices.push(
new THREE.Vector3(-h, -h, -h),
new THREE.Vector3(-h, h, -h),
new THREE.Vector3(-h, h, -h),
new THREE.Vector3(h, h, -h),
new THREE.Vector3(h, h, -h),
new THREE.Vector3(h, -h, -h),
new THREE.Vector3(h, -h, -h),
new THREE.Vector3(-h, -h, -h),
new THREE.Vector3(-h, -h, h),
new THREE.Vector3(-h, h, h),
new THREE.Vector3(-h, h, h),
new THREE.Vector3(h, h, h),
new THREE.Vector3(h, h, h),
new THREE.Vector3(h, -h, h),
new THREE.Vector3(h, -h, h),
new THREE.Vector3(-h, -h, h),
new THREE.Vector3(-h, -h, -h),
new THREE.Vector3(-h, -h, h),
new THREE.Vector3(-h, h, -h),
new THREE.Vector3(-h, h, h),
new THREE.Vector3(h, h, -h),
new THREE.Vector3(h, h, h),
new THREE.Vector3(h, -h, -h),
new THREE.Vector3(h, -h, h)
);
return geometry;
}
function onWindowResize() {
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
renderer.setSize(window.innerWidth, window.innerHeight);
}
function animate() {
requestAnimationFrame(animate);
render();
}
function render() {
var time = Date.now() * 0.001;
renderer.render(scene, camera);
}