Dark Bit Factory & Gravity
PROGRAMMING => General coding questions => Topic started by: nawitus on December 30, 2007
-
I have the camera at CamX,CamY and CamZ, and I need to calculate QX1,QY1,QZ1,QX2,QY2,QZ2,QX3,QY3,QZ3,QX4,QY4 and QZ1 for the quad at position QuadX,QuadY,QuadZ. The quad coordinates must be calculated so that the quad is facing the camera..
Any help or links? I'm not fan of 3D/trig math :-\
-
hmm.. if you managed to get a 3d camera then you have all the information you may need. If I understand you well, you are trying to display a quad that is facing the camera, if yes, then this is called a billboard.
Check this: http://nehe.gamedev.net/data/articles/article.asp?article=19
it should be pretty simple for you to get something out of this... but it would be good to learn some 3d math (vectors, matrices, trigonometry) to understand all this correctly. What's your math level??
-
Thanks, I'll look into that tomorrow. I'm on my first year at uni, and I *should* know that math.
edit: I used the point sprite extension, which saved me from all the math (and is faster). :clap: