Results 1 to 6 of 6

Thread: change only z-position

  1. #1

    change only z-position

    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!
    Last edited by zyhsu; 05-15-2003 at 05:19 AM.

  2. #2
    obfuscated SDK hacker Lightwolf's Avatar
    Join Date
    Feb 2003
    Location
    Stuttgart, Germany
    Posts
    13,539
    Hi zyhsu.
    I'm not that fluent in LScript, but have you tried object.Position.z = <value> ?

  3. #3
    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);
    }
    "The hardness of God is kinder than the softness of men, and His compulsion is our liberation." - C.S. Lewis


  4. #4
    obfuscated SDK hacker Lightwolf's Avatar
    Join Date
    Feb 2003
    Location
    Stuttgart, Germany
    Posts
    13,539
    Originally posted by faulknermano
    ah, lightwolf, dont i wish.
    Hi faulknermano,

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

    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

  5. #5

    thanks

    thanks faulknermano!
    this works!!
    z.y.hsu

  6. #6

    thank

    thanks LightWolf!
    I appreciate your post!
    but I think the pos.z is only for get value, not for set value!
    Z.y.hsu

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •