Camera Direction Vector
by Daniel Ly · in Torque Game Engine · 07/14/2006 (1:37 pm) · 0 replies
Hey,
I've been trying make some modifications on the Cel Shading Resource by David Michael:
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=10318
One of the things I need to do is instead of calculating the shading value by using the vector from the sun to each of the polygons, I need to use vector from the camera to each polygon. I've been trying to dglGetModelview() to get the unit vector, but it doesn't seem to work at all. (It also doesn't much that I have no idea what each column of the returned matrix represents).
Oh, and I'm using the Advanced Camera resource (incase that makes things more difficult..)
Any suggestions on what to do or what is stored in the dglGetModelview() Matrix? Thanks a lot!
Daniel
Edit: Typo
I've been trying make some modifications on the Cel Shading Resource by David Michael:
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=10318
One of the things I need to do is instead of calculating the shading value by using the vector from the sun to each of the polygons, I need to use vector from the camera to each polygon. I've been trying to dglGetModelview() to get the unit vector, but it doesn't seem to work at all. (It also doesn't much that I have no idea what each column of the returned matrix represents).
Oh, and I'm using the Advanced Camera resource (incase that makes things more difficult..)
Any suggestions on what to do or what is stored in the dglGetModelview() Matrix? Thanks a lot!
Daniel
Edit: Typo
About the author