PDA

View Full Version : change only z-position



zyhsu
05-15-2003, 06:16 AM
Hi;
1. I understand I can use commandinput "Position(x,y,z)" to change object position, but what if I only want to change z value but keep x and y value, can I use "Positon(x,y,z)" but give some mark or symbol to x and y value to keep them unchanged?or any other simple method beside use channel object agent?
Thanks!

Lightwolf
05-15-2003, 06:54 AM
Hi zyhsu.
I'm not that fluent in LScript, but have you tried object.Position.z = <value> ?

faulknermano
05-15-2003, 07:01 AM
ah, lightwolf, dont i wish. :)


zyhsu: the solution is to get the item's current position and not to change it when you are applying the position:

[code]
generic
{
s = Scene().firstSelect();
pos = s.getPosition(Scene().currenttime);
newposz = 5; // your desired z position
Position(pos.x,pos.y,newposz);
}

Lightwolf
05-15-2003, 07:05 AM
Originally posted by faulknermano
ah, lightwolf, dont i wish. :)
Hi faulknermano,

OT:
see, this is why I stick to good 'ole C :p

LScript might be easier to quickly hack together and check out, but somehow, I seem to be faster in C (and yes, I've read the new LScript docs... There's still lot's left to explain).

Cheers,
Mike

zyhsu
05-19-2003, 08:43 AM
thanks faulknermano!
this works!!
z.y.hsu

zyhsu
05-19-2003, 08:46 AM
thanks LightWolf!
I appreciate your post!
but I think the pos.z is only for get value, not for set value!
Z.y.hsu