Page 1 of 1

FPS camera without using FPScamera...

Posted: Wed Aug 24, 2005 10:13 am
by Zoulz
I'd like to know how to re-create the FPS camera without using the existing fpscamera supplied with irrlicht. The reason for this is because I want to be able to control the event reciever on my own.

How does the rotation part work? setting the direction of the camera only takes a vector.. how would I go about creating a direction vector from a X & Y degree?

Posted: Wed Aug 24, 2005 6:30 pm
by WToma
The simplest way, I think, is to copy the code of FPS camera and just change the event receiver part.
If you want to create a direction vector, you can do as the following:
let alpha be the angle around y axis and let beta be the angle around x axis. We use degrees as unit, because most irrlicht functions use degrees, too. Then you can create your direction vector:

Code: Select all

//first, we convert the angles into radians
float alpha_rad=(alpha/180.0f)*M_PI;
float beta_rad=(beta/180.0f)*M_PI;
direction_vector=core::vector3df(cos(alpha_rad), sin(beta_rad), sin(alpha_rad));
Toma

Posted: Fri Aug 26, 2005 7:31 pm
by Acki
Have a look at my 2nd post in this thread:

http://irrlicht.sourceforge.net/phpBB2/ ... 0ec26bc26e

Maybe this could help you...

Posted: Sat Aug 27, 2005 12:17 am
by Nick_Japan
If you want the built-in FPS camera and also to control the event receiver, rig up your own receiver as described in the tutorials, but return false instead of true if it's a camera event. This tells Irrlicht that you haven't dealt with the event yourself and so it will be passed to the default event receiver and therefore picked up by your FPS camera.