2023-08-14 19:22:04 +02:00
|
|
|
function __3dCube() : __3dObject() constructor {
|
|
|
|
VF = global.VF_POS_NORM_TEX_COL;
|
|
|
|
render_type = pr_trianglelist;
|
|
|
|
|
|
|
|
static initModel = function(size) {
|
|
|
|
size /= 2;
|
|
|
|
|
2023-08-23 20:01:09 +02:00
|
|
|
vertex = [[
|
2023-09-18 13:54:55 +02:00
|
|
|
new __vertex(-size, -size, size).setNormal(0, 0, 1).setUV(1, 1),
|
|
|
|
new __vertex( size, size, size).setNormal(0, 0, 1).setUV(0, 0),
|
|
|
|
new __vertex( size, -size, size).setNormal(0, 0, 1).setUV(0, 1),
|
2023-08-23 20:01:09 +02:00
|
|
|
|
2023-09-18 13:54:55 +02:00
|
|
|
new __vertex(-size, -size, size).setNormal(0, 0, 1).setUV(1, 1),
|
|
|
|
new __vertex(-size, size, size).setNormal(0, 0, 1).setUV(1, 0),
|
|
|
|
new __vertex( size, size, size).setNormal(0, 0, 1).setUV(0, 0),
|
2023-08-22 20:10:09 +02:00
|
|
|
|
2023-08-23 20:01:09 +02:00
|
|
|
|
2023-09-18 13:54:55 +02:00
|
|
|
new __vertex(-size, -size, -size).setNormal(0, 0, -1).setUV(1, 1),
|
|
|
|
new __vertex( size, -size, -size).setNormal(0, 0, -1).setUV(0, 1),
|
|
|
|
new __vertex( size, size, -size).setNormal(0, 0, -1).setUV(0, 0),
|
2023-08-23 20:01:09 +02:00
|
|
|
|
2023-09-18 13:54:55 +02:00
|
|
|
new __vertex(-size, -size, -size).setNormal(0, 0, -1).setUV(1, 1),
|
|
|
|
new __vertex( size, size, -size).setNormal(0, 0, -1).setUV(0, 0),
|
|
|
|
new __vertex(-size, size, -size).setNormal(0, 0, -1).setUV(1, 0),
|
2023-08-23 20:01:09 +02:00
|
|
|
|
|
|
|
|
2023-09-18 13:54:55 +02:00
|
|
|
new __vertex(-size, -size, size).setNormal(-1, 0, 0).setUV(1, 0),
|
|
|
|
new __vertex(-size, size, -size).setNormal(-1, 0, 0).setUV(0, 1),
|
|
|
|
new __vertex(-size, size, size).setNormal(-1, 0, 0).setUV(0, 0),
|
2023-08-23 20:01:09 +02:00
|
|
|
|
2023-09-18 13:54:55 +02:00
|
|
|
new __vertex(-size, -size, size).setNormal(-1, 0, 0).setUV(1, 0),
|
|
|
|
new __vertex(-size, -size, -size).setNormal(-1, 0, 0).setUV(1, 1),
|
|
|
|
new __vertex(-size, size, -size).setNormal(-1, 0, 0).setUV(0, 1),
|
2023-08-23 20:01:09 +02:00
|
|
|
|
|
|
|
|
2023-09-18 13:54:55 +02:00
|
|
|
new __vertex( size, -size, size).setNormal(1, 0, 0).setUV(0, 0),
|
|
|
|
new __vertex( size, size, size).setNormal(1, 0, 0).setUV(1, 0),
|
|
|
|
new __vertex( size, size, -size).setNormal(1, 0, 0).setUV(1, 1),
|
2023-08-23 20:01:09 +02:00
|
|
|
|
2023-09-18 13:54:55 +02:00
|
|
|
new __vertex( size, -size, size).setNormal(1, 0, 0).setUV(0, 0),
|
|
|
|
new __vertex( size, size, -size).setNormal(1, 0, 0).setUV(1, 1),
|
|
|
|
new __vertex( size, -size, -size).setNormal(1, 0, 0).setUV(0, 1),
|
2023-08-23 20:01:09 +02:00
|
|
|
|
|
|
|
|
2023-09-18 13:54:55 +02:00
|
|
|
new __vertex(-size, size, size).setNormal(0, 1, 0).setUV(1, 0),
|
|
|
|
new __vertex( size, size, -size).setNormal(0, 1, 0).setUV(0, 1),
|
|
|
|
new __vertex( size, size, size).setNormal(0, 1, 0).setUV(0, 0),
|
2023-08-23 20:01:09 +02:00
|
|
|
|
2023-09-18 13:54:55 +02:00
|
|
|
new __vertex(-size, size, size).setNormal(0, 1, 0).setUV(1, 0),
|
|
|
|
new __vertex(-size, size, -size).setNormal(0, 1, 0).setUV(1, 1),
|
|
|
|
new __vertex( size, size, -size).setNormal(0, 1, 0).setUV(0, 1),
|
2023-08-14 19:22:04 +02:00
|
|
|
|
2023-08-23 20:01:09 +02:00
|
|
|
|
2023-09-18 13:54:55 +02:00
|
|
|
new __vertex(-size, -size, size).setNormal(0, -1, 0).setUV(0, 0),
|
|
|
|
new __vertex( size, -size, size).setNormal(0, -1, 0).setUV(1, 0),
|
|
|
|
new __vertex( size, -size, -size).setNormal(0, -1, 0).setUV(1, 1),
|
2023-08-29 19:26:18 +02:00
|
|
|
|
2023-09-18 13:54:55 +02:00
|
|
|
new __vertex(-size, -size, size).setNormal(0, -1, 0).setUV(0, 0),
|
|
|
|
new __vertex( size, -size, -size).setNormal(0, -1, 0).setUV(1, 1),
|
|
|
|
new __vertex(-size, -size, -size).setNormal(0, -1, 0).setUV(0, 1),
|
2023-08-23 20:01:09 +02:00
|
|
|
]];
|
2023-08-14 19:22:04 +02:00
|
|
|
|
|
|
|
VB = build();
|
|
|
|
} initModel(1);
|
|
|
|
}
|