Skip to main content
gamedev.net
🔒 Locked

lightsource positions

Started by cozzie 1 reply 500+ views
Original Post
cozzie
cozzie
Hi. In my first opengl 3d engine I have lightsources, I've experimented lots of things with both directional and positional lights (position/vector): x, y, z, 0 or 1. 0 for positional, 1 for directional. Somehow I can't see the logics in my light's position when I add positional lights. Is there an easy way to setup a radius for a positional lightsource, so I can find out where the lightsources exactly are. Maybe I'm missing a part of the openGL lighting theory, if so, please tell me. Thanks.
Crealysm game & engine development: http://www.crealysm.com

Looking for a passionate, disciplined and structured producer? PM me
stein
stein
An easy way to see where your lightsources are, is to draw some simple GL_POINTS at the same coordinates... Also, don't forget that you must set the position of the light, after any tranformations you want applied.
| Stein Nygård - http://steinware.dk |
_DarkWIng_
_DarkWIng_
Quote:
Original post by cozzie
Maybe I'm missing a part of the openGL lighting theory, if so, please tell me. Thanks.

OpenGL Red Book has a whole chapter on lighting. Maybe you should read that to get some more information how lighting in opengl actualy works.
You should never let your fears become the boundaries of your dreams.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.