#### Archived

This topic is now archived and is closed to further replies.

# worldspace -> objectspace

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

## Recommended Posts

hi, i hope there some matrix experts here at gamedev ;-) . i''ve got a question on them: when i have a matrix to transform objectspace to worldspace, how can i calculate a matrix witch transforms worldspace to objectspace from it? (I need this for lighting calculations)

##### Share on other sites
quote:
Original post by Kylotan
Isn''t that just the inverse matrix?

Yes, it is.

##### Share on other sites
of course it is, but calculating an inverse matrix is expensive, an i have to do it several times per frame, i thougt maybe somebody knows a faster way (considering that the matrix contains only tranformation, scaling and rotation)
one idea i had was just store tranformation, scaling and rotation seperate, and than compute the inverse from that...but this will cause other problems. maybe I should explain the whole problem:
i'am using a 2d and a 1d texture to fake 3d textures on gf2 (using register combiners) for per-pixel-atentuation. because this is not a true 3d texture i can't use the 3rd dimension in the texcoords (and the texture matrix), so i have to transform the texcoords in software. it would be much faster to transform the lightsource to object space, but i have to inverse a matix for that...witch is slow. a faster way to do this (maybe in hardware) would be great.

[edited by - 123cs on June 1, 2002 11:57:47 AM]

[edited by - 123cs on June 1, 2002 11:59:58 AM]

##### Share on other sites
Well, if your matrices only store 3x3 rotations, you could simply take the transpose. Doesn''t work with translation and scaling though. But since you''re doing the transformation on the CPU, you could simply multiply by the transposed rotation matrix and apply the scaling/translation afterwards (or before, depends on your matrix setup). This would be reasonably fast for lightsources.

/ Yann

##### Share on other sites
well the idea is good, but i don''t have access to to world translation/scaling, because my objects are organized in a scene-graph, and a node only stores translation/scaling/rotation relative to its parent, and the world tranformation matrix(4x4), witch is calculated during graph updating.

1. 1
Rutin
40
2. 2
3. 3
4. 4
5. 5

• 18
• 19
• 12
• 14
• 9
• ### Forum Statistics

• Total Topics
633362
• Total Posts
3011531
• ### Who's Online (See full list)

There are no registered users currently online

×