# Specific rotation for particle instances

 Thread Tools Search this Thread Display Modes
 11 November 2013 GreenGuy 3D Generalist   portfolio Sascha Gongala Stoke-on-Trent, United Kingdom 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 GreenGuy 3D Generalist   portfolio Sascha Gongala Stoke-on-Trent, United Kingdom 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 PurpleRainbow Veteran portfolio Nika Maisuradze tbilisi, Georgia 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 GreenGuy 3D Generalist   portfolio Sascha Gongala Stoke-on-Trent, United Kingdom Great! Thank you so much. share quote
 11 November 2013 mandark1011 Expert   portfolio Michael Lemon Fx Artist Canada 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 CGTalk Moderation Expert 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. __________________ CGTalk Policy/Legalities Note that as CGTalk Members, you agree to the terms and conditions of using this website. 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.