• Welcome to Dark Bit Factory & Gravity.
 

Point a quad towards camera

Started by nawitus, December 30, 2007

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

nawitus

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  :-\

stormbringer

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??
We once had a passion
It all seemed so right
So young and so eager
No end in sight
But now we are prisoners
In our own hearts
Nothing seems real
It's all torn apart

nawitus

#2
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: