PDA

View Full Version : Orthographic projected textures



soconne
05-01-2005, 09:23 PM
Does anybody know of a tutorial or source code that shows how to perform projected texturing using an orthographic project ?

I've tried to set it up myself using glOrtho and gluLookAt but I cannot seem to get the camera view set up correctly in relation to the actual light source. The scene always appears backwards or not in the right place at all.

knackered
05-02-2005, 03:36 AM
What do you mean?
1/ You're rendering your scene with an orthographic projection and you want to, inside that scene, project a texture from a light source onto the scene using a perspective projection?
or...
2/ You're rendering your scene in some arbitary way, and, inside that scene, you want to project a texture from a light source onto the scene using an orthographic projection (which would just be straight texturing with the texture coordinates transformed by the light matrix wouldn't it?)

soconne
05-02-2005, 04:01 AM
I'm rendering my scene with a perspective projection. But then I want to switch to an orthographic projection, render the scene again from the light's point of view, then save that to a texture.

The problem I'm having is getting gluLookAt to work correctly after calling glOrtho. I cannot seem to get it to work correctly and get the view to be cenetered at the light source and have the same view direction as the light.

CrazyButcher
05-02-2005, 05:06 AM
might be helpful showing us how you set up things currently