mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-11-11 04:54:06 +01:00
27 lines
619 B
Plaintext
27 lines
619 B
Plaintext
function __3dPlane() : __3dObject() constructor {
|
|
VF = global.VF_POS_NORM_TEX_COL;
|
|
render_type = pr_trianglelist;
|
|
|
|
static initModel = function(size) {
|
|
size /= 2;
|
|
|
|
vertex = [
|
|
V3(-size, -size, 0), V3(size, -size, 0), V3(size, size, 0),
|
|
V3(-size, -size, 0), V3(size, size, 0), V3(-size, size, 0),
|
|
];
|
|
|
|
normals = [
|
|
[0, 0, 1], [0, 0, 1], [0, 0, 1],
|
|
[0, 0, 1], [0, 0, 1], [0, 0, 1],
|
|
];
|
|
|
|
uv = [
|
|
[0, 0], [1, 0], [1, 1],
|
|
[0, 0], [1, 1], [0, 1],
|
|
];
|
|
|
|
array_foreach(vertex, function(val, ind) { val.normal.set(normals[ind]); val.uv.set(uv[ind]); })
|
|
|
|
VB = build();
|
|
} initModel(1);
|
|
} |