Page 1 of 1
[Solved] Rotating particles
Posted: Wed Feb 01, 2017 4:44 pm
by kubatp
Hi,
I am very new to particles and I was trying to find the answer in manual or forum threads, but I was not able to find it. My question is - is it possible to rotate particles?
I have a boat emitting particles behind during movement, but they always have the same rotation. I need them to rotate (either vertices or at least textures) according to the direction of the boat.
Is it possible?
Thank you very much.
Re: Rotating particles
Posted: Wed Feb 01, 2017 5:13 pm
by xrgo
Hello, you need to use a rotation affector =)
I dont have script snippets at hand, but in case you need c++ code:
Code: Select all
Ogre::RotationAffector* newRotator = (Ogre::RotationAffector*)myParticleSystem->addAffector("Rotator");
newRotator->setRotationSpeedRangeEnd( Ogre::Radian(somevalue) );
newRotator->setRotationSpeedRangeStart( Ogre::Radian(somevalue) );
cheers
Re: Rotating particles
Posted: Wed Feb 01, 2017 5:21 pm
by kubatp
xrgo wrote:Hello, you need to use a rotation affector =)
Hi Xrgo, thank you for such a quick reply. I already read about Rotator affector here
http://www.ogre3d.org/docs/manual/manua ... r-Affector , but this is more like a random rotation, isnt it?
Or you mean that with every rotation of the boat (sceneNode) I also have to set the rotation to the emittor in code?
There is no way how to tell the emittor something like "always rotate the particles the same as the scenenode is"?
Re: Rotating particles
Posted: Wed Feb 01, 2017 5:43 pm
by xrgo
yes thats a random rotator.... you can use "local_space true" or in c++
Code: Select all
myParticleSystem->setKeepParticlesInLocalSpace(true);
with that the particles will follow the scenenode in every transform, that means it will also follow the movement, that's usually something you don't want. not sure if that's what you want to achieve
Re: Rotating particles
Posted: Wed Feb 01, 2017 5:51 pm
by kubatp
xrgo wrote:with that the particles will follow the scenenode in every transform, that means it will also follow the movement, that's usually something you don't want. not sure if that's what you want to achieve
I already tried that. This is not what I want.
Thank you for your answer. I just wanted to know if there is a way how to achieve this in general without updating the values all the time.
Thank you very much Xrgo