Jump to content
Sign in to follow this  
Mr.Peanut

worldToModel

Recommended Posts

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.

Share this post


Link to post
Share on other sites

Opps,

Sorry didn't read properly mixed modeltoworld with worldtomodel  banghead.gif

Please feel free to delete this smile_o.gif

Share this post


Link to post
Share on other sites
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.

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
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.

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.

Syntax: object worldToModel worldPos

Example:

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).

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×