Eye space? World space? I'M LOST!

Started by
5 comments, last by Code-R 18 years, 1 month ago
I'm a bit lost about this. now, when I specify a vertex/normal using the glVertex/Normal calls, I specify it in Model space. now, Multiplying that in my shader with the ModelView matrix yields it in Eye space (I'm not sure i'm even correct about this). now, how can I get it in WORLD space? and what's the difference between world space (global coord, if i know what i'm blabbering about) and eye space? TIA
Advertisement
>> I specify it in Model space.

Usually in GL land it's called Object space but Model space works fine too. :)

>> how can I get it in WORLD space?

You'll have to keep track of your matrices yourself for this one. To get into world coordinates (space) you'd need to multiply by the model part of the modelview matrix. But since GL puts those two matrices together, that's why you would need to keep track of the matrices yourelf.

>> and what's the difference between world space and eye space?

Eye space is where the eye is at the origin, world it's not. The viewing transform after the modelling transform is what makes this happen. There's some old presentations (from quite a few years ago) at NVIDIA's dev site that talk about per pixel lighting/bump mapping by Cass Everitt that describe this with pictures.



-SirKnight

The ModelView matrix is a combination of the model-to-world transform and the world-view transform, allowing you to do the model-to-view (view space == eye space) transform in one step. Eye/view space is the world transformed so it is viewed from your (or your eye's/camera's) location. To get from model space to world space you just need the model-to-world transform (i.e. the combination of translations, rotations, and scales you apply to your model to get it in the right position).
Quote:Original post by Anonymous Poster
The ModelView matrix is a combination of the model-to-world transform and the world-view transform, allowing you to do the model-to-view (view space == eye space) transform in one step. Eye/view space is the world transformed so it is viewed from your (or your eye's/camera's) location. To get from model space to world space you just need the model-to-world transform (i.e. the combination of translations, rotations, and scales you apply to your model to get it in the right position).


Bugger, that was me (too trigger-happy with the 'Ok'/'Cancel' prompt)! Hope it's some help. :)
ok, that made it clear now! thanks, ratings++. But I hve one more question: how can I transform a point/vector (mainly a light's position/direction) from worldspace to eyespace, given the eye's view position, direction and up vector?

edit: Got some idea, not sure about it. by acquiring the right vector (view dir cross up dir), I can get a 3x3 matrix (front, up and right - not sure how should I order them though) that I could multiply the 3d position , as a vector by it (or multiply it by the vector - as you can see I'm not that good at math: I got the rought concept but I need some guidance through the details.)
Quote:Original post by Code-R
ok, that made it clear now! thanks, ratings++. But I hve one more question: how can I transform a point/vector (mainly a light's position/direction) from worldspace to eyespace, given the eye's view position, direction and up vector?

edit: Got some idea, not sure about it. by acquiring the right vector (view dir cross up dir), I can get a 3x3 matrix (front, up and right - not sure how should I order them though) that I could multiply the 3d position , as a vector by it (or multiply it by the vector - as you can see I'm not that good at math: I got the rought concept but I need some guidance through the details.)


Take a look at the bottom of this man page for a world space to eye space transformation matrix given the eye's translation, view vector, and up vector.
thanks, I'll be using it. I have no idea why they didn't pack the translate call into the matrix too, but I'll be doing it. thanks a lot, rating++.

This topic is closed to new replies.

Advertisement