PDA

View Full Version : vector variable issues


r2m
03-23-2003, 01:38 PM
i can't get this script to work the way i want.
it's suppose to rotate randomly the current selection with different values for every object.
when i use it, all the objects have the same rotation.
where did i got wrong ?
(except for the silly names of my variables ? :p )

string $prout2[] = `ls -sl`;
string $p;
for ($p in $prout2)
{
vector $prout_rot5 = sphrand(15);
rotate -r ($prout_rot5.x) ($prout_rot5.y) ($prout_rot5.z);
};

bigfatMELon
03-24-2003, 12:35 AM
You aren't selecting them individually within the loop, so everything in the selection is being rotated by a random number each time through the loop.


string $prout2[] = `ls -sl`;
string $p;
for ($p in $prout2)
{
vector $prout_rot5 = sphrand(15);
select -r $p;
rotate -r ($prout_rot5.x) ($prout_rot5.y) ($prout_rot5.z);
};
select -r $prout2;

-jl

r2m
03-25-2003, 07:27 PM
thx man !
:beer:

CGTalk Moderation
01-14-2006, 05: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.