View Single Post
# 4 19-10-2011 , 09:29 PM
ctbram's Avatar
Moderator
Join Date: Jan 2004
Location: Michigan, USA
Posts: 2,998
one appraoch would be to ...

create an array of objects O[] from 1 to n.

subroutine swap
{
pick a random index i from 1 to n
if i != n then swap O[i] with O[n]
pick a random index i from 1 to n-1
if i != n-1 then swap O[i] with O[n-1]
now swap the <x,y,z> attributes of the objects in O[n] and O[n-1]
}

every time you call swap() two objects will swap positions

I will leave it to you to create the python or mel code.


"If I have seen further it is by standing on the shoulders of giants." Sir Isaac Newton, 1675

Last edited by ctbram; 19-10-2011 at 09:34 PM.