kreyszig

09-30-2008, 05:40 AM

hi,

i'm doing projective texture mapping. I want to visualise the projection that I'm using - i.e draw say a pyramid with the top at the light position and the rest aligned with the projection (frustrum) i'm using.

I would like to use the terms given to glFrustrum = i.e a top, bottom, left right, near and far.

I know glFrustrum calculates a matrix in eye space, and I would initially create my pyramid according to these coordinates. How can I take this pyramid and transform it to the light position?

I have a modelview matrix for the light, which allows me to render from that position. I'm not sure how to go from this to a transform that I can actually apply to my "pyramid" though.

Thanks for any help>!

EDIT: I know how to do construct this using vectors (i have a light direction) but would like to know how to do this by transforming a given set of vertices in eye space. cheers!

i'm doing projective texture mapping. I want to visualise the projection that I'm using - i.e draw say a pyramid with the top at the light position and the rest aligned with the projection (frustrum) i'm using.

I would like to use the terms given to glFrustrum = i.e a top, bottom, left right, near and far.

I know glFrustrum calculates a matrix in eye space, and I would initially create my pyramid according to these coordinates. How can I take this pyramid and transform it to the light position?

I have a modelview matrix for the light, which allows me to render from that position. I'm not sure how to go from this to a transform that I can actually apply to my "pyramid" though.

Thanks for any help>!

EDIT: I know how to do construct this using vectors (i have a light direction) but would like to know how to do this by transforming a given set of vertices in eye space. cheers!