GLlight and GLlookat versus GLtranslate

Started by
3 comments, last by Aidamina 19 years, 2 months ago
Well i got two questions and i decided to post em in one thread but they are completely different from each other. Question one: How do the GLlight functions work. I've read a lot of articles about them, but none of them explained me how the light points work eg. when i set the position of the light is it a point which radiates to every side, or is it a beam. And is there a limitation how far the light extents in an opengl app. Question two: At the moment im using gltranslate to move around in a 3d application i am writing. This works ok, but i was wondering if GlLookat would be better or would give better performance, enlighten me. Slap me if these are noob questions :D Greetz Aidamina PS I'm sorry for my crappy English
-->My Site<--
Advertisement
Google always helps, even if you have to look in odd places. I found this assignment rather useful when it came to figuring out exactly what everything was, and I'm pretty sure it'll help you figure it out too.

As for the gluLookAt problem, it all depends on your needs. For something like cameras, I personally see it as a static camera, which would change as you switched rooms, always pointing at the main character, or a camera on the side of a track that follows a car that goes racing by. With a few more modifications you could turn it from this into a 'look-from' camera (as used in FPS games, looks from some position at some position that can be calculated from the rotations on the 3 axiis), or even a 'look-at-3rd-person' camera (which sits behind the character at some distance, where the now 'look-from' position can be calculated the same way the normal 'look-from' camera is). On the other hand, if you just want something simple (like an over-head view of a city/landscape), translating the position is more than enough.
Thx Gorax

That was a great reference, but this leaves me with a few questions:

Quote:And is there a limitation how far the light extends in an opengl app.


And i know which one is the easiest. I'm just wondering which one will give the best performance asin framerate.

Greetz,
Aidamina
-->My Site<--
Quote:Original post by Aidamina
Thx Gorax

That was a great reference, but this leaves me with a few questions:

Quote:And is there a limitation how far the light extends in an opengl app.


Lights extends to infinity. You can set some attenuation factors to attenuate the light over distance, but they will never fade completely.

Quote:
Original post by Aidamina
And i know which one is the easiest. I'm just wondering which one will give the best performance asin framerate.

Greetz,
Aidamina

They just create a matrix which is passed to OpenGL. How it was created doesn't matter, it's just a set of numbers to OpenGL, and different functions are just different ways of generating these numbers.
Thx
-->My Site<--

This topic is closed to new replies.

Advertisement