Specific rotation for particle instances


#1

Hi,

I am in the process of creating a city with the particle instancer. Now I wish to wish each particle to be rotated either 0,90,180 or 270 degrees. How can I do that?
Thanks in advance for your help.


#2

Can´t be so hard right?
I type an expression for random rotation:
rotationPP = <<rand(0), rand(360), rand(0)>>;
and then I will have to tell it that if the rotation value is between 1 and 89, 91 and 179, 181 and 269 then lifespanPP = 0. Would that work?
I simply do not know how to write an expression for it. Can somebody help me with that?


#3

create an expression for rotationPP:

float $rand = rand(360);
if ($rand < 90)
    nParticleShape1.rotationPP = 0;
else if ($rand < 180)
    nParticleShape1.rotationPP = 90;
else if ($rand < 270)
    nParticleShape1.rotationPP = 180;
else if ($rand < 360)
    nParticleShape1.rotationPP = 270;

Obviosly, replace “nParticleShape1” with you particle object name. Should work


#4

Great! Thank you so much.


#5

this works too

create an float PP attribute (numChoose)

//creation

numChoose = int(rand(-.49,3.49));

if (numChoose == 0)
rotationPP = 0;
else if (numChoose == 1)
rotationPP = 90;
else if (numChoose ==2)
rotationPP = 180;
else
rotationPP = 270;


#6

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.