Jump to content
  • Advertisement

Archived

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

123cs

worldspace -> objectspace

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
quote:
Original post by Kylotan
Isn''t that just the inverse matrix?


Yes, it is.

Share this post


Link to post
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 this post


Link to post
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 this post


Link to post
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.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!