PDA

View Full Version : can't figure out how to project textures



fkmpa
04-27-2005, 03:00 AM
i have a projector, of which i know:
pinhole position (px,py,pz)
rotation matrix (3x3 R)
focal distance (f)
image size (w,h pixels)
image bias (cx,cy center coordinates in pixels)
pixel size (ps)

also, my GL_PROJECTION matrix is set as:
float sz=4*min(scrsize.GetWidth(),scrsize.GetHeight());
glFrustum(-.001*scrsize.GetWidth()/sz,.001*scrsize.GetWidth()/sz,-.001*scrsize.GetHeight()/sz,.001*scrsize.GetHeight()/sz,.001,1000);

and my view matrix is simply set by:
glRotatef(ax,1,0,0);
glRotatef(ay,0,1,0);
glRotatef(az,0,0,1);
glTranslatef(ex,ey,ez);

i want to be able to project the image of my projector on any surface, as described in various articles i found on the subject of "projective textures" (e.g. the nvidia one).

i cannot figure out exactly what the various matrices involved are. can anybody help me? i have tried everything except the correct solution(both in object and eye space).

thank you

fkmpa
04-27-2005, 07:13 AM
resolved