[Solved] Rotating particles

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
kubatp
Gnome
Posts: 368
Joined: Tue Jan 06, 2009 1:12 pm
x 43

[Solved] Rotating particles

Post 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.
Last edited by kubatp on Wed Apr 05, 2017 9:19 pm, edited 1 time in total.
xrgo
OGRE Expert User
OGRE Expert User
Posts: 1148
Joined: Sat Jul 06, 2013 10:59 pm
Location: Chile
x 168

Re: Rotating particles

Post 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
kubatp
Gnome
Posts: 368
Joined: Tue Jan 06, 2009 1:12 pm
x 43

Re: Rotating particles

Post 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"?
xrgo
OGRE Expert User
OGRE Expert User
Posts: 1148
Joined: Sat Jul 06, 2013 10:59 pm
Location: Chile
x 168

Re: Rotating particles

Post 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
kubatp
Gnome
Posts: 368
Joined: Tue Jan 06, 2009 1:12 pm
x 43

Re: Rotating particles

Post 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
Post Reply