nicolasbol

11-14-2009, 12:08 AM

I do my lighthing calculation in model space and hence hace to transform the light pos from world to model space fast.

The model transformation is basically M = [T] * [R]

Given a matrix:

Xaxisx YAxisx ZAxisx Translationx

Xaxisy YAxisy ZAxisy Translationy

Xaxisz YAxisz ZAxisz Translationz

0 0 0 1

I wonder if a shortcut would be valid:

Xaxisx XAxisy XAxisz -Translationx

Yaxisx YAxisy YAxisz -Translationy

Zaxisx ZAxisy ZAxisz -Translationz

0 0 0 1

Or do I have to do M = [R]-1 * [T]-1

The model transformation is basically M = [T] * [R]

Given a matrix:

Xaxisx YAxisx ZAxisx Translationx

Xaxisy YAxisy ZAxisy Translationy

Xaxisz YAxisz ZAxisz Translationz

0 0 0 1

I wonder if a shortcut would be valid:

Xaxisx XAxisy XAxisz -Translationx

Yaxisx YAxisy YAxisz -Translationy

Zaxisx ZAxisy ZAxisz -Translationz

0 0 0 1

Or do I have to do M = [R]-1 * [T]-1