Has anyone used worldToModel successfully? It keeps giving me [0,0,0] for everything.
Edit: actually it keeps giving me back the horizontal coords as [0,0] the vertical seems okay.
Sorry didn't read properly mixed modeltoworld with worldtomodel ***
Please feel free to delete this
uhm yes. it works good. Remember. If you request the model space coodinates of the object position (given in world pos) that the model space belongs to, then it will be [0,0,0] because it describes the (world) position of the model center. But if you use the coodinates of a different object/place/whatever then it will be successfully converted to the model space of the object specified in the command.
Originally Posted by (Mr.Peanut @ June 09 2007,02:05)
opus justitiae pax
What I am getting is a position well outside the bounding box is still returning [0,0] as the horizontal coord. If you have a working example please post it.
Edit: never mind just did simple test in editor. I must have screwed something else up. Thanks.
I suspect your vertical position working is due to something else. Also it doesn't depend on the bounding box but on the position and the corresponding model.
Originally Posted by (Mr.Peanut @ June 09 2007,03:01)
Syntax: object worldToModel worldPos
object is a tank
worldpos is the position of the round the tank fired.
now when you getPos the round you will get it's worldPos coordinates. But if you want the round position as an offset to the tank model center you use
myTank worldToModel positionOfRound
this works flawlessly for me.
however if I do tankRound worldToModel positionOfRound it will return [0,0,0] (as the offset is zero as I compared the tankRound model center world pos converted to model space with itself and there is no difference).