camera normal vector ?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
chinanzio
Posts: 25
Joined: Wed Apr 11, 2007 10:56 am

camera normal vector ?

Post by chinanzio »

I want to throw a ball with normal direccion to the camera . how can i get this vector ?

i've tried with camera->getTarget() but i don't know why the ball doesn't take the direction i want

if some one wants , i paste some code
omar shaaban
Posts: 616
Joined: Wed Nov 01, 2006 6:26 pm
Location: Cairo,Egypt
Contact:

Post by omar shaaban »

:? your english is not very clear but from what i understood u want to throw a ball at the direction of the camera so all u have to do is to
vector3df targertpos=camera->gettarget()
and then take the z and x direction of the ball !
Luben
Posts: 568
Joined: Sun Oct 09, 2005 10:12 am
Location: #irrlicht @freenode

Post by Luben »

Code: Select all

vector3df NormalizedCameraZAxis = (Camera->getTarget() - Camera->getPosition()).normalize();
If you don't have anything nice to say, don't say anything at all.
chinanzio
Posts: 25
Joined: Wed Apr 11, 2007 10:56 am

Post by chinanzio »

Luben wrote:

Code: Select all

vector3df NormalizedCameraZAxis = (Camera->getTarget() - Camera->getPosition()).normalize();
yes , sorry by my english . thank you Luben , this is the code i needed.
Post Reply