Author Topic: Point a quad towards camera  (Read 2681 times)

0 Members and 1 Guest are viewing this topic.

Offline nawitus

  • C= 64
  • **
  • Posts: 50
  • Karma: 1
    • View Profile
Point a quad towards camera
« 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  :-\

Offline stormbringer

  • Time moves by fast, no second chance
  • Amiga 1200
  • ****
  • Posts: 453
  • Karma: 73
    • View Profile
    • www.retro-remakes.net
Re: Point a quad towards camera
« Reply #1 on: December 30, 2007 »
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

Offline nawitus

  • C= 64
  • **
  • Posts: 50
  • Karma: 1
    • View Profile
Re: Point a quad towards camera
« Reply #2 on: December 30, 2007 »
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:
« Last Edit: January 12, 2008 by nawitus »