# Specific rotation for particle instances

 11 November 2013 #1 GreenGuy 3D Generalist   portfolio Sascha Gongala Stoke-on-Trent, United Kingdom   Join Date: Jun 2009 Posts: 68 Specific rotation for particle instances 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. share quote
 11 November 2013 #2 GreenGuy 3D Generalist   portfolio Sascha Gongala Stoke-on-Trent, United Kingdom   Join Date: Jun 2009 Posts: 68 Canīt be so hard right? I type an expression for random rotation: rotationPP = <>; 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? share quote
 11 November 2013 #3 PurpleRainbow Veteran portfolio Nika Maisuradze tbilisi, Georgia   Join Date: May 2006 Posts: 49 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 share quote
 11 November 2013 #4 GreenGuy 3D Generalist   portfolio Sascha Gongala Stoke-on-Trent, United Kingdom   Join Date: Jun 2009 Posts: 68 Great! Thank you so much. share quote
 11 November 2013 #5 mandark1011 Expert   portfolio Michael Lemon Fx Artist Canada   Join Date: Apr 2003 Posts: 1,042 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; __________________ Showreel RnD share quote
 11 November 2013 #6 CGTalk Moderation Expert   Join Date: Sep 2003 Posts: 1,066,473 Thread automatically closed 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. share quote

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts vB code is On Smilies are On [IMG] code is On HTML code is Off CGSociety Society of Digital Artists www.cgsociety.org Powered by vBulletinCopyright Đ2000 - 2006, Jelsoft Enterprises Ltd.