Is it possible to change the orientation of the flycircle animator?, that is, instead of circling around the Y-axis, would it be possible to rotate it and make it fly around the X-axis instead? I tried using setRotation() but it doesn't seem to be doing anything...
Any ideas?
is it possible to rotate a flycircleAnimator?
thanks for the reply etcaptor.
see the image. The motion path of the flycircle animation by default is the green circle. I was wondering how you could turn the motion path into the blue circle.
I looked at the API and there was no option to turn the motion path to the blue circle. I also tried rotating the SceneNode that was being animated but it didn't work.
This is the code so far:
any ideas?
see the image. The motion path of the flycircle animation by default is the green circle. I was wondering how you could turn the motion path into the blue circle.
I looked at the API and there was no option to turn the motion path to the blue circle. I also tried rotating the SceneNode that was being animated but it didn't work.
This is the code so far:
Code: Select all
// add light
light = smgr->addLightSceneNode(0, core::vector3df(0,100.0f,1200.0f),
video::SColorf(0.5f, 1.0f, 0.5f, 0.0f), 200.0f);
lightData = &light->getLightData();
lightData->Radius = 100.0f;
lightData->AmbientColor = SColorf(255.0f,255.0f,255.0f,50.0f);
light->setPosition(core::vector3df(1529*2,4031*2,5658*2));
light->setMaterialFlag(video::EMF_LIGHTING, true);
light->setMaterialType(video::EMT_LIGHTMAP_LIGHTING);
// add fly circle animator to light 1
scene::ISceneNodeAnimator* lightAnimator = smgr->createFlyCircleAnimator(core::vector3df(50,10000,10000),1900.0f, 0.001f);
light->addAnimator(lightAnimator);
lightAnimator->drop();
any ideas?
Sory, now I understood.
Here is a code of this animator.
You can improve it. By example if you use:
will get animate function via YZ.
You can add some variables or methods for choising behaviour of animator - via Y, YZ or XZ axis.
Here is a code of this animator.
Code: Select all
//! animates a scene node
void CSceneNodeAnimatorFlyCircle::animateNode(ISceneNode* node, u32 timeMs)
{
Node = node;//ivo
core::matrix4 mat;
f32 t = (timeMs-StartTime) * Speed;
core::vector3df circle(Radius * (f32)sin(t), 0, Radius * (f32)cos(t));
node->setPosition(Center + circle);
}
Code: Select all
core::vector3df circle(Radius * (f32)sin(t), 0, Radius * (f32)cos(t));
You can add some variables or methods for choising behaviour of animator - via Y, YZ or XZ axis.