2023-08-14 19:22:04 +02:00
|
|
|
function __3dCube() : __3dObject() constructor {
|
|
|
|
VF = global.VF_POS_NORM_TEX_COL;
|
|
|
|
render_type = pr_trianglelist;
|
|
|
|
|
2024-10-20 09:05:33 +02:00
|
|
|
static initModel = function() {
|
2023-08-14 19:22:04 +02:00
|
|
|
|
2024-10-20 09:05:33 +02:00
|
|
|
vertex = [
|
|
|
|
[
|
|
|
|
new __vertex(-.5, -.5, .5).setNormal(0, 0, 1).setUV(1, 1),
|
|
|
|
new __vertex( .5, .5, .5).setNormal(0, 0, 1).setUV(0, 0),
|
|
|
|
new __vertex( .5, -.5, .5).setNormal(0, 0, 1).setUV(0, 1),
|
|
|
|
|
|
|
|
new __vertex(-.5, -.5, .5).setNormal(0, 0, 1).setUV(1, 1),
|
|
|
|
new __vertex(-.5, .5, .5).setNormal(0, 0, 1).setUV(1, 0),
|
|
|
|
new __vertex( .5, .5, .5).setNormal(0, 0, 1).setUV(0, 0),
|
|
|
|
|
|
|
|
|
|
|
|
new __vertex(-.5, -.5, -.5).setNormal(0, 0, -1).setUV(1, 1),
|
|
|
|
new __vertex( .5, -.5, -.5).setNormal(0, 0, -1).setUV(0, 1),
|
|
|
|
new __vertex( .5, .5, -.5).setNormal(0, 0, -1).setUV(0, 0),
|
|
|
|
|
|
|
|
new __vertex(-.5, -.5, -.5).setNormal(0, 0, -1).setUV(1, 1),
|
|
|
|
new __vertex( .5, .5, -.5).setNormal(0, 0, -1).setUV(0, 0),
|
|
|
|
new __vertex(-.5, .5, -.5).setNormal(0, 0, -1).setUV(1, 0),
|
|
|
|
|
|
|
|
|
|
|
|
new __vertex(-.5, -.5, .5).setNormal(-1, 0, 0).setUV(1, 0),
|
|
|
|
new __vertex(-.5, .5, -.5).setNormal(-1, 0, 0).setUV(0, 1),
|
|
|
|
new __vertex(-.5, .5, .5).setNormal(-1, 0, 0).setUV(0, 0),
|
|
|
|
|
|
|
|
new __vertex(-.5, -.5, .5).setNormal(-1, 0, 0).setUV(1, 0),
|
|
|
|
new __vertex(-.5, -.5, -.5).setNormal(-1, 0, 0).setUV(1, 1),
|
|
|
|
new __vertex(-.5, .5, -.5).setNormal(-1, 0, 0).setUV(0, 1),
|
|
|
|
|
|
|
|
|
|
|
|
new __vertex( .5, -.5, .5).setNormal(1, 0, 0).setUV(0, 0),
|
|
|
|
new __vertex( .5, .5, .5).setNormal(1, 0, 0).setUV(1, 0),
|
|
|
|
new __vertex( .5, .5, -.5).setNormal(1, 0, 0).setUV(1, 1),
|
|
|
|
|
|
|
|
new __vertex( .5, -.5, .5).setNormal(1, 0, 0).setUV(0, 0),
|
|
|
|
new __vertex( .5, .5, -.5).setNormal(1, 0, 0).setUV(1, 1),
|
|
|
|
new __vertex( .5, -.5, -.5).setNormal(1, 0, 0).setUV(0, 1),
|
|
|
|
|
|
|
|
|
|
|
|
new __vertex(-.5, .5, .5).setNormal(0, 1, 0).setUV(1, 0),
|
|
|
|
new __vertex( .5, .5, -.5).setNormal(0, 1, 0).setUV(0, 1),
|
|
|
|
new __vertex( .5, .5, .5).setNormal(0, 1, 0).setUV(0, 0),
|
|
|
|
|
|
|
|
new __vertex(-.5, .5, .5).setNormal(0, 1, 0).setUV(1, 0),
|
|
|
|
new __vertex(-.5, .5, -.5).setNormal(0, 1, 0).setUV(1, 1),
|
|
|
|
new __vertex( .5, .5, -.5).setNormal(0, 1, 0).setUV(0, 1),
|
|
|
|
|
|
|
|
|
|
|
|
new __vertex(-.5, -.5, .5).setNormal(0, -1, 0).setUV(0, 0),
|
|
|
|
new __vertex( .5, -.5, .5).setNormal(0, -1, 0).setUV(1, 0),
|
|
|
|
new __vertex( .5, -.5, -.5).setNormal(0, -1, 0).setUV(1, 1),
|
|
|
|
|
|
|
|
new __vertex(-.5, -.5, .5).setNormal(0, -1, 0).setUV(0, 0),
|
|
|
|
new __vertex( .5, -.5, -.5).setNormal(0, -1, 0).setUV(1, 1),
|
|
|
|
new __vertex(-.5, -.5, -.5).setNormal(0, -1, 0).setUV(0, 1),
|
|
|
|
]
|
|
|
|
];
|
2023-10-28 10:53:11 +02:00
|
|
|
|
2023-08-14 19:22:04 +02:00
|
|
|
VB = build();
|
2024-10-20 09:05:33 +02:00
|
|
|
} initModel();
|
2023-08-14 19:22:04 +02:00
|
|
|
}
|