• Hey! Guest! The 36th GMC Jam will take place between February 27th, 12:00 UTC - March 2nd, 12:00 UTC. Why not join in! Click here to find out more!

3D [SOLVED] I need help with 3D lighting

Bearman_18

Member
I started work on making a little 3D project for the first time recently. I wrote a script that makes cubes, made a first-person camera, added player controls (walking, jumping), and added physics (collisions, movement, gravity, etc.).
Epic.PNG

Pretty epic, yeah?

Anyway, I thought now would be a good time to add some lighting. I figure that I should probably learn how to make shaders for the best results, but in the meantime I'm going to use the built-in draw functions for lighting.

I wrote the following code:
Code:
draw_set_lighting(true);
draw_light_define_point(1,0,0,-32,10000,c_white);
draw_light_enable(1,true);
This should, from what I can tell, place a far-reaching white light at one corner of the room, 32 units above the ground. The only problem is that it doesn't.

I've tried placing this code in the create, step, and draw events of my controller object, I've tried placing it in it's own object, and I've tried placing it immediately after the code that builds all the vertexes (in case it has to come after, but that doesn't seem to be the case). I've also checked a couple tutorials (the only ones I could find, anyway), but haven't noticed a difference between what they're doing and what I'm doing, unless it has something to do with the cube model itself.

Naturally I'm willing to provide any code from the project that you request to see. Also, the vertex format includes 3D positions, colour, and texture coordinates.

Thanks in advance!
 
Top