# Light Shaft Help(Solved)

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

## Recommended Posts

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]

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

##### Share on other sites
Quote:
 Original post by MJPWhy 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!

1. 1
2. 2
Rutin
16
3. 3
4. 4
5. 5

• 26
• 11
• 9
• 9
• 11
• ### Forum Statistics

• Total Topics
633708
• Total Posts
3013469
×