kamiyasi
Member
Hi there. I'm simulating the position of the sun in 3D space like so:
Now what I would like to do is find the vectors that would point those x,y, and z values towards room_width/2, room_height/2, and 0. I want to find these vectors so I can use them in d3d_light_define_direction.
In other words, I want the 3D position of my global.light variables to define the vector of my directional light.
Code:
dayloop += 0.5;
if dayloop > 360 then dayloop -= 360;
global.lightx = lengthdir_x((3600),dayloop*10);
global.lighty = (room_height/2);
global.lightz = lengthdir_y((3600),dayloop*10);
In other words, I want the 3D position of my global.light variables to define the vector of my directional light.