PDA

View Full Version : Problem / Random rotation on selected objects


lowpolygon
03-01-2004, 04:35 PM
Hi, I am trying to create a script which allows selected objects
to rotate randomly. I managed to get the random rotation going
but all objects are rotating at the same angle. What I want is
to make all seleced objects rotate in different angles

KaMe
03-03-2004, 05:36 PM
sarr = selection as array
count = sarr.count + 1
i = 1
while i < count do
(
select sarr[i]
rotate $ (eulerangles (random 0 360) (random 0 360) (random 0 360))
i += 1
)

I'm not very good at MAXScript, but you can use this script to rotate all selected objects in a random way.

PEN
03-03-2004, 06:03 PM
Or Simplier.

<code>
for x in selection do
(
rotate x (eulerAngles (random -360 360) (random -360 360) (random -360 360))
)
</code>

The code posted by KaMe needs to have the the object selected to work. This will slow the process down allot as selections have to keep changing.

KaMe
03-03-2004, 06:12 PM
Yeah thats true when you have a lot of objects in the scene...
Your script is much simplier and much faster. I didn't know of this MAXScript 'ability', really good to know. :]

CGTalk Moderation
01-17-2006, 02:00 PM
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.