3D 3D Light not working

N

NoCodeMonkey

Guest
Code:
tex = background_get_texture(bBox); // Store a texture into variable
d3d_draw_block(200, 300, boxHight, boxLength, 350, 0, tex, 1, 1); // Draw square shape with texture of tex

d3d_set_lighting(true); // Turn lighting on
d3d_light_define_point(1, 250, 0, -50, 2000, c_white); // Set point of light source
d3d_light_enable(1, true); // Turn light #1 on;
When I run the game the block is black and the light is not working. I don't know what I'm doing wrong.
 
N

NoCodeMonkey

Guest
Make sure that your light is neither inside nor behind the box from the camera's perspective.
Code:
d3d_set_lighting(true); // Turn lighting on
d3d_light_define_point(1, oLight.x, oLight.y, -50, 2000, c_white); // Set point of light source
d3d_light_enable(1, true); // Turn light #1 on;
I put the code into another object named oLight and made it so the light position is based on where i put the object into the room. Where ever i put it still same black block with no light.
 
N

NoCodeMonkey

Guest
nvm i got it working lol i messed around with the define point variable and was able to get the block to light up
 
Top