Pixel-Composer/scripts/d3d_light/d3d_light.gml

39 lines
1.1 KiB
Plaintext
Raw Normal View History

2023-08-14 19:22:04 +02:00
function __3dLight() : __3dObject() constructor {
UI_vertex = [];
for( var i = 0; i <= 32; i++ )
UI_vertex[i] = [ 0, lengthdir_x(0.5, i / 32 * 360), lengthdir_y(0.5, i / 32 * 360), c_yellow, 0.8 ];
VB_UI = build(noone, UI_vertex);
color = c_white;
intensity = 1;
static presubmit = function(params = {}) {
2023-08-15 19:35:31 +02:00
var _rot = new __rot3(0, 0, 0).lookAt(position, params.camera.position);
2023-08-14 19:22:04 +02:00
var rot = matrix_build(0, 0, 0,
_rot.x, _rot.y, _rot.z,
1, 1, 1);
var sca = matrix_build(0, 0, 0,
0, 0, 0,
0.6, 0.6, 0.6);
var pos = matrix_build(position.x, position.y, position.z,
0, 0, 0,
1, 1, 1);
matrix_stack_clear();
matrix_stack_push(pos);
matrix_stack_push(rot);
matrix_set(matrix_world, matrix_stack_top());
vertex_submit(VB_UI, pr_linestrip, -1);
matrix_stack_push(sca);
matrix_set(matrix_world, matrix_stack_top());
vertex_submit(VB_UI, pr_linestrip, -1);
matrix_stack_clear();
matrix_set(matrix_world, matrix_build_identity());
}
static shine = function(params = {}) {}
}