2023-08-17 16:56:54 +02:00
|
|
|
function __3dCubeFaces() : __3dObject() constructor {
|
|
|
|
VF = global.VF_POS_NORM_TEX_COL;
|
|
|
|
render_type = pr_trianglelist;
|
2023-08-22 20:10:09 +02:00
|
|
|
object_counts = 6;
|
2023-08-17 16:56:54 +02:00
|
|
|
|
|
|
|
static initModel = function(size) {
|
|
|
|
size /= 2;
|
|
|
|
|
|
|
|
vertex = [
|
|
|
|
[
|
2023-08-23 20:01:09 +02:00
|
|
|
V3(-size, -size, size).setNormal(0, 0, 1).setUV(0, 0),
|
|
|
|
V3( size, size, size).setNormal(0, 0, 1).setUV(1, 0),
|
|
|
|
V3( size, -size, size).setNormal(0, 0, 1).setUV(1, 1),
|
|
|
|
|
|
|
|
V3(-size, -size, size).setNormal(0, 0, 1).setUV(0, 0),
|
|
|
|
V3(-size, size, size).setNormal(0, 0, 1).setUV(1, 1),
|
|
|
|
V3( size, size, size).setNormal(0, 0, 1).setUV(0, 1),
|
2023-08-17 16:56:54 +02:00
|
|
|
],
|
|
|
|
[
|
2023-08-23 20:01:09 +02:00
|
|
|
V3(-size, -size, -size).setNormal(0, 0, -1).setUV(0, 0),
|
|
|
|
V3( size, -size, -size).setNormal(0, 0, -1).setUV(1, 0),
|
|
|
|
V3( size, size, -size).setNormal(0, 0, -1).setUV(1, 1),
|
|
|
|
|
|
|
|
V3(-size, -size, -size).setNormal(0, 0, -1).setUV(0, 0),
|
|
|
|
V3( size, size, -size).setNormal(0, 0, -1).setUV(1, 1),
|
|
|
|
V3(-size, size, -size).setNormal(0, 0, -1).setUV(0, 1),
|
2023-08-17 16:56:54 +02:00
|
|
|
],
|
2023-08-23 20:01:09 +02:00
|
|
|
[
|
|
|
|
V3(-size, -size, size).setNormal(-1, 0, 0).setUV(0, 0),
|
|
|
|
V3(-size, size, -size).setNormal(-1, 0, 0).setUV(1, 0),
|
|
|
|
V3(-size, size, size).setNormal(-1, 0, 0).setUV(1, 1),
|
|
|
|
|
|
|
|
V3(-size, -size, size).setNormal(-1, 0, 0).setUV(0, 0),
|
|
|
|
V3(-size, -size, -size).setNormal(-1, 0, 0).setUV(1, 1),
|
|
|
|
V3(-size, size, -size).setNormal(-1, 0, 0).setUV(0, 1),
|
2023-08-17 16:56:54 +02:00
|
|
|
],
|
2023-08-23 20:01:09 +02:00
|
|
|
[
|
|
|
|
V3( size, -size, size).setNormal(1, 0, 0).setUV(0, 0),
|
|
|
|
V3( size, size, size).setNormal(1, 0, 0).setUV(1, 0),
|
|
|
|
V3( size, size, -size).setNormal(1, 0, 0).setUV(1, 1),
|
|
|
|
|
|
|
|
V3( size, -size, size).setNormal(1, 0, 0).setUV(0, 0),
|
|
|
|
V3( size, size, -size).setNormal(1, 0, 0).setUV(1, 1),
|
|
|
|
V3( size, -size, -size).setNormal(1, 0, 0).setUV(0, 1),
|
2023-08-17 16:56:54 +02:00
|
|
|
],
|
2023-08-23 20:01:09 +02:00
|
|
|
[
|
|
|
|
V3(-size, size, size).setNormal(0, 1, 0).setUV(0, 0),
|
|
|
|
V3( size, size, -size).setNormal(0, 1, 0).setUV(1, 0),
|
|
|
|
V3( size, size, size).setNormal(0, 1, 0).setUV(1, 1),
|
|
|
|
|
|
|
|
V3(-size, size, size).setNormal(0, 1, 0).setUV(0, 0),
|
|
|
|
V3(-size, size, -size).setNormal(0, 1, 0).setUV(1, 1),
|
|
|
|
V3( size, size, -size).setNormal(0, 1, 0).setUV(0, 1),
|
|
|
|
],
|
|
|
|
[
|
|
|
|
V3(-size, -size, size).setNormal(0, -1, 0).setUV(0, 0),
|
|
|
|
V3( size, -size, size).setNormal(0, -1, 0).setUV(1, 0),
|
|
|
|
V3( size, -size, -size).setNormal(0, -1, 0).setUV(1, 1),
|
|
|
|
|
|
|
|
V3(-size, -size, size).setNormal(0, -1, 0).setUV(0, 0),
|
|
|
|
V3( size, -size, -size).setNormal(0, -1, 0).setUV(1, 1),
|
|
|
|
V3(-size, -size, -size).setNormal(0, -1, 0).setUV(0, 1),
|
2023-08-17 16:56:54 +02:00
|
|
|
]
|
|
|
|
];
|
2023-08-22 20:10:09 +02:00
|
|
|
|
2023-08-17 16:56:54 +02:00
|
|
|
VB = build();
|
2023-08-23 20:01:09 +02:00
|
|
|
generateNormal();
|
2023-08-17 16:56:54 +02:00
|
|
|
} initModel(1);
|
|
|
|
}
|