# Eye space? World space? I'M LOST!

This topic is 4669 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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

##### Share on other sites
>> 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

##### Share on other sites
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).

##### Share on other sites
Quote:
 Original post by Anonymous PosterThe 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. :)

##### Share on other sites
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.)

##### Share on other sites
Quote:
 Original post by Code-Rok, 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.

##### Share on other sites
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++.

1. 1
2. 2
3. 3
Rutin
15
4. 4
khawk
13
5. 5
frob
12

• 9
• 9
• 11
• 11
• 23
• ### Forum Statistics

• Total Topics
633669
• Total Posts
3013257
×