matrix - Sequence of transformations: Projective Texturing (HLSL) -


when reading this article on projective texturing (9.3.2) on nvidia, came across graph:

http://http.developer.nvidia.com/cgtutorial/elementlinks/252equ01.jpg

the order in transformations written confused me. because learned read matrix multiplication left right , because thought sequence of transformations should go in order:

http://http.developer.nvidia.com/cgtutorial/elementlinks/fig4_1.jpg

now questions following:

because matrix multiplication not commutative, order should multiplications in?

and if indeed in same order sequence of transformations of normal objects, why written this?

by same order of sequence mean hlsl code:

float4 worldposition        = mul(input.position, world); float4 viewposition         = mul(worldposition, view); output.position             = mul(viewposition, projection); 

finally (and optional might usefull others wondering same), how write hlsl code projective texturing multiplication or how transformations if passed complete matrix via xna.

your transformation can written symbolically as

y = t p v w x

where:

x = (x0, y0, z0, w0)t: object coordinates (column vector 4x1)
y = (s, t, r, q)t: window space coordinates (column vector 4x1)
w: world modelling matrix (4x4)
v: view modelling matrix (4x4)
p: projection matrix (4x4)
t: viewport transformation matrix (4x4)

the calculation performed as:

y = t (p (v (w x)))

i.e. right left. hlsl code be:

float4 worldposition  = mul(world, input.position);     // w x float4 viewposition   = mul(view, worldposition);       // v (w x) float4 projposition   = mul(projection, viewposition);  // p (v (w x)) float4 vportposition  = mul(viewport, projposition);    // t (p (v (w x))) 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -