Jump to content
  • Advertisement
Sign in to follow this  
spythebeast

Reciprocal of homogenous w

This topic is 4752 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

Could anybody explain what "Reciprocal of homogenous w" means? It appears in my directx book without much explaination, and I can't seem to find a clear answer on google... thanks

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by spythebeast
Could anybody explain what "Reciprocal of homogenous w" means?
It appears in my directx book without much explaination, and I can't seem to find a clear answer on google...

thanks


1 / w ?

HTH,
Cambo_frog

Share this post


Link to post
Share on other sites
It is 1.0f / W; but the "origin" of it is to do with the matrix mathematics that are done under the covers...

To be honest, I never rememeber exactly what it means - I just leave it set to 1.0f and ignore it [smile]

iirc, the positional data is stored as a 4 component vector [x,y,z,w] and when it's fed through the transform matrices, the w component needs to be 1.0f so that it works with whatever space it's in (again, not 100% sure). In normal 3D geometry this is done by multiplying through by 1.0f / w. When you deal with all the transforms (e.g. using D3DFVF_XYZRHW transformed vertices) then you need to take care of this yourself. Setting rhw=1.0f will NOT modify your [x,y,z] components.

Maybe someone else can explain it better in the Maths & Physics forum.

hth
Jack

Share this post


Link to post
Share on other sites
It's all about transformations.
When you are scaling or rotating your model, the formulas may be written as a 3x3 matrix. Applying transformation is then simply multiplying your vertices by a matrix. But the move transformation [translation] doesn't conform to this schema, because it uses addition, not multiplication.
To make all transformations go in the same manner, 3D cards uses so called "homogeneous coordinate system". In that system there is additional coordinate called W. If W=1 then homogeneous coordinate accords to typical cartesian coordinate [X,Y,Z]. But using that additional coordinate allows us to do all the transformations in the same way: by matrix multiplication. Vertices has then 4 coordinates [last W=1] and matrices are 4x4.

OK, now what is the "reciprocal of homogeneous W"? Homogeneous W is that fourth coordinate in vertex definition, and its reciprocal is 1/W. It is used in a projection transformation.

Share this post


Link to post
Share on other sites
Nice Answer SasQ,
I didn't want to assume any context from the spythebeasts original post, so posted the most basic answer, but I guess your assumptions are correct.
(To spybeast) As jollyjeffers implies by his post, a DX matrix (4x4 homogeneous) usually has 1.0 as W if projection is not involved (e.g rotation, scaling, translation) and therefor reciprocal of W is 1.0
As SasQ states/implies W could be other than 1.0 in a projection matrix( e.g. a perspective transformation).
If you are trying to achieve something in particular with matrices please post more info from your book to give more context to "Reciprocal of homogenous w".

Also note that if you are using vertex shaders you can use matrices other than 4x4 homogeneous for effeciency, depending on the particular transformations you are using (e.g. a world transformation can be a 4x3 matrix to convert position coordinates to view space or 3x3 to convert normals to view space).

HTH,
Cambo_frog

[Edited by - Cambo_frog on May 22, 2005 3:04:19 PM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!