how to fly camera follow spline?

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
lab_zj
Posts: 26
Joined: Wed May 21, 2008 3:25 am

how to fly camera follow spline?

Post by lab_zj »

I have many points that served as a track, and I want fly camera follow this track with optional offset, and require camera's direction always toward the front (the track point's tangent direction).

currently, I use ISceneManager::createFollowSplineAnimator(), that can control camera follow track (a spline), but the fly speed seems not uniform and sometime backward fly, and the camera's direction also not controlled.

So, If I want camera fly by my rule, I must write myself animator?

thanks.
randomMesh
Posts: 1186
Joined: Fri Dec 29, 2006 12:04 am

Re: how to fly camera follow spline?

Post by randomMesh »

lab_zj wrote:I have many points that served as a track, and I want fly camera follow this track...
...I use ISceneManager::createFollowSplineAnimator(), ... but the fly speed seems not uniform and sometime backward fly, and the camera's direction also not controlled.
A spline is not just a set of way points. It interpolates between them.
Image
irrlicht api wrote: The animator modifies the position of
the attached scene node to make it follow a hermite spline.
It uses a subset of hermite splines: either cardinal splines
(tightness != 0.5) or catmull-rom-splines (tightness == 0.5).
lab_zj wrote:So, If I want camera fly by my rule, I must write myself animator?
No, createFollowSplineAnimator() should be fine if properly used.
lab_zj wrote:and the camera's direction also not controlled

Code: Select all

camera->setTarget()
"Whoops..."
lab_zj
Posts: 26
Joined: Wed May 21, 2008 3:25 am

Post by lab_zj »

thank you very much, I will try again.
Reiko
Posts: 105
Joined: Sun Aug 16, 2009 7:06 am
Location: Australia

Re: how to fly camera follow spline?

Post by Reiko »

lab_zj wrote:and the camera's direction also not controlled.
you could try the ideas put forward in this thread

http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=22480

I did see another thread the other day with a different idea but now I cant find it again.
lab_zj
Posts: 26
Joined: Wed May 21, 2008 3:25 am

Post by lab_zj »

thanks for your reply. I have write my track animator, that can exactly control camera's position and rotation based on time-key-frame interpolate, the camera always fly with uniform speed and smoothly rotate.
Post Reply