Skip to main content
GameDev.net gamedev.net
🔒 Locked 🎮 Unity

Light Shaft Help(Solved)

Started by wmonash Dec 3, 2008 at 6:50 AM 1 replies 1.1k views
Original Post
wmonash
wmonash
Im a little confused at how to transform light frustum from light space to view space In mitchell_lightshafts's paper, they use // Transformation from light space to view space D3DXMatrixInverse (&matFrustumWorld, NULL, &m_matLightView); D3DXMatrixMultiply (&matFrustumWorldView, &matFrustumWorld, g_matWorldView); But it dosen't make scense in my situation... Here is what i did. D3DXVECTOR3 kSource(200.0f, 200.0f, 200.0f); D3DXVECTOR3 kTarget(0.0f, 0.0f, 0.0f); D3DXVECTOR3 kDUp(0.0f, 0.0f, 1.0f); D3DXMATRIX mLightView; D3DXMatrixLookAtLH (&mLightView, &kSource, &kTarget, &kDUp); // Transformation from light space to view space D3DXMATRIX matFrustumWorld; D3DXMatrixInverse (&matFrustumWorld, NULL, &matLightView); D3DXMatrixMultiply (&matFrustumWorldView, &matFrustumWorld, &mView); Any info would be great helpful. [Edited by - wmonash on December 3, 2008 9:37:52 AM]
MJP
MJP
Why do you have a "lightView" and a "lightWorld" matrix? You only need one, since a view matrix is just the inverse of the world matrix. This is why the code from the paper merely takes the inverse of the of LightView matrix to get the world matrix. You should be able to do the same.
wmonash
wmonash
Quote:
Original post by MJP
Why do you have a "lightView" and a "lightWorld" matrix? You only need one, since a view matrix is just the inverse of the world matrix. This is why the code from the paper merely takes the inverse of the of LightView matrix to get the world matrix. You should be able to do the same.


Thx MJP, you are right!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.