-
Notifications
You must be signed in to change notification settings - Fork 0
/
skybox.js
85 lines (67 loc) · 1.54 KB
/
skybox.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
function SkyBox(){
this.superficie = null;
this.x = null;
this.y = null;
this.z = null;
this.create = function(_x, _y, _z, pos, color) {
this.x = _x;
this.y = _y;
this.z = _z;
this.superficie = new Cuadrado();
this.superficie.skybox = true;
this.superficie.create(this.x, this.y, this.z, color);
this.superficie.translate([pos[0], pos[1], pos[2]]);
}
this.translate_acum = function(v){
this.superficie.translate_acum(v);
this.techo.translate_acum(v);
}
this.translate = function(v){
this.superficie.translate(v);
this.techo.translate(v);
}
this.scale_abs = function(_x, _y, _z){
this.superficie.scale_abs(_x, _y, _z);
}
this.draw = function(mvMatrix_scene){
this.superficie.draw(mvMatrix_scene);
}
this.setupWebGLBuffers = function(){
this.superficie.setupWebGLBuffers();
}
this.initTexture = function(texture){
var texture_buffer = this.create_text_buffer();
this.superficie.addTexture(texture);
this.superficie.asign_text_buffer(texture_buffer);
}
this.create_text_buffer = function(){
var texture_buffer = [];
texture_buffer = [
1, 2/3,
0.75, 2/3,
0.75, 1/3,
1, 1/3,
0.25, 2/3,
0.25, 1/3,
0.5, 1/3,
0.5, 2/3,
0.25, 1/3,
0.25, 0,
0.5, 0,
0.5, 1/3,
0.25, 2/3,
0.5, 2/3,
0.5, 1,
0.25, 1,
0.5, 2/3,
0.5, 1/3,
0.75, 1/3,
0.75, 2/3,
0.25, 2/3,
0, 2/3,
0, 1/3,
0.23, 1/3,
];
return texture_buffer;
}
}