[Closed] Help with transformations – URGENT
Hi all,
Sorry to ask this type of question however I am trying to add the final touches to some animation which is part of a university assigment. I have a scene with a bus (bus1) I am trying to write some script to move if from one set of co-ordinates to another, stop for a while and then start moving again to another set of co-ordinates.
I have placed this bus (bus1) at the following co-ordinates: -460.914cm, -7721.673cm, 169.865cm (xyz respectively). Within my max script I have the following code:
bus1=$bus1
bus.pos=[-460.914, -7721.673, 169.865]
animate on
(at time 0 bus1.pos=([-460.914, -7721.673, 169.865])
at time 200 bus1.pos=([-461.558, -4046.918, 0])
)
When I execute the script my bus1 moves straight away to 1172.357cm, 19796.663cm 0cm. Which a moves the bus of the path it needs to be on and move its down which intersects the road. If I change the value of Z to 169.865 it moves the bus up which is too high.
Is there something I am not doing or something I am doing incorrectly.
I appreciate any help anyone can provide as my assignment is due in tomorrow morning.
Thank you and please, please help.
Without knowing much about your scene, I’d start off by moving the pivot of the bus to pos.z=0. If you’re moving this bus in a straight path, along a horizontal road, then your bus1.pos.z at time 0 should be the same as bus1.pos.z at time 200 (in other words, z should always equal 0, if in fact it’s moving on a horizontal path). The position property is an explicit value relative to the world coordinates, so your xyz values are going to determine where it will end up, not where it will move relative to it’s initial position. Also, I noticed that your first position assignment is using an undefined variable (bus) in this statement, instead of the bus1 variable you declared:
bus.pos=[-460.914, -7721.673, 169.865]
hope this helps a bit.