Reciprocal of homogenous w

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

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 on other sites
sorry to bump this, but somebody must know...
Or did I post this in the wrong forum?

Share on other sites
Quote:
 Original post by spythebeastCould 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 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 on other sites
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 on other sites
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 on other sites
Check this post on DevMaster for information on homegeneous W: Homegeneous coordinates

• Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 16
• 30
• 9
• 16
• 22