# Computing w component of vertices?

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

## Recommended Posts

I am currently trying to implement shadow volumes following a paper from NVidia on this subject (find it here). They are rendering the volume faces using glVertex4f(x,y,z,w), supplying a w component as fourth argument. The paper mentions a plane equation Ax+By+Cz+Dw=0, but I only know Ax+By+Cz+d=0 (where (A,B,C) is the plane's normal and (x,y,z) a point of the plane). How do I compute this w component?

##### Share on other sites
Nice theory, thanks, but I still don't know how to compute my w's for shadow rendering following that NVidia document now. What is the w of the light position? 1.0? And how do I get the w of a an object's silhouette vertex?

##### Share on other sites
Well what ever w is it is a common ratio that is applied to x,y,z as per that article. When w is supplied and is not equal to 1.0 then the points are multiplied by that ratio of w.

w isn't a real number, it is imaginary. It holds no real value other than plotting imaginary points in space from what I understand.

Maybe if you explained what you need to use the w for I could assist you a little more.

I suppose an interesting use would be to plot a 3 dimensional figure volumetrically by keeping the same x,y,z coords and just modifying the w coord > 1.0 and < 1.0 which would create a sort of "voluming" effect on your object.

##### Share on other sites
I have understood how the w param is applied, but the article doesn't mention any numerical values for w - the authors just juggle around with it. I think they just included it for completeness, in case someone actually used this value. So I am using 1.0 in my code.

Actually I am trying to draw a shadow volume. This w param is mentioned when projecting two vertices of an object's silhouette's edge to infinity, as seen from a singular light source. I just can't get this to work though. It looks totally whacked on screen. Here is an image:

Currently I am using a single light source to make debugging easier. As far as I can tell, I have taken the code literally from the document linked to in my first post. You can see that this works by no way though. It looks like a lot of the model faces don't get drawn, or some of the zpass/zfail test don't work or whatever.

Holy crap, why isn't there a single useful tutorial on OpenGL in the whole internet. This stuff looked so simple.

[Edited by - karx11erx on April 1, 2006 3:51:39 AM]

1. 1
Rutin
38
2. 2
3. 3
4. 4
5. 5

• 12
• 15
• 12
• 14
• 9
• ### Forum Statistics

• Total Topics
633354
• Total Posts
3011494
• ### Who's Online (See full list)

There are no registered users currently online

×