how to modify camera behaviour

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
r0d
Posts: 3
Joined: Wed Feb 04, 2009 3:47 pm

how to modify camera behaviour

Post by r0d »

Hello :)

i will try to make a strategy game with IrrLicth. I already got the model done (i always follow the MVC - Model View Controler - pattern), and the controler will need fiew changes. Neither the audio part won't change very much i guess.

The main work is on the view part: the 3d scene in my case.

I compiled the tutorial 12 (terrain rendering), and it's perfect for what i need. But there's something i don't understand: how to modify the behaviour of the camera.

I undestood that the first step is to intercept the event with an EventReceiver, and return true on OnEvent to avoid others treatments on the event. But i don't understand how to move the camera :oops: The interface ICameraSceneNode don't have member functions such as Rotate() or Move().
Sylence
Posts: 725
Joined: Sat Mar 03, 2007 9:01 pm
Location: Germany
Contact:

Post by Sylence »

You have to implement ICameraSceneNode yourself or use one of the existing cameras of Irrlicht (e.g. the FPS or Maya-style camera)
Software documentation is like sex. If it's good you want more. If it's bad it's better than nothing.
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

[Moved to Beginners' Help]

ICameraSceneNode is derived from ISceneNode, so all of the ISceneNode methods also apply, i.e. setPosition().

Cameras as a bit funny about rotations though. ICameraSceneNode::setTarget() is the most unambiguous method of telling a camera where to look. You can use ISceneNode::setRotation(), if you call ICameraSceneNode::bindTargetAndRotation(true) first (this is the default for FPS cameras).
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Post Reply