celery 8 Posted November 18, 2007 Can anyone supply me with a formula to setpos object1 two meters to the right of object2's position regardless of object2's azimuth? I'm having trouble finding out how to "anchor" the setpos coordinates to an object's vector. Share this post Link to post Share on other sites
DBO_ 0 Posted November 18, 2007 i think you need modeltoworld relpos = [0,2,0] worldpos = object1 modeltoworld relpos object2 setpos worldpos object2 setdir getdir object1 not sure on [0,2,0] could be -2 have a mess with it Share this post Link to post Share on other sites
celery 8 Posted November 18, 2007 Thanks, you are precious! Share this post Link to post Share on other sites
zaphod 0 Posted November 18, 2007 no problem with azimuts ... <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _dst=2; _pos=getpos obj1; _dir=(getdir obj1)-90; _dpos=[(_pos select 0)+(sin _dir)*_dst,(_pos select 1)+(cos _dir)*_dst,0]; should work, but not tested... Share this post Link to post Share on other sites
Junker 0 Posted November 18, 2007 i think you need modeltoworldrelpos = [0,2,0] worldpos = object1 modeltoworld relpos object2 setpos worldpos object2 setdir  getdir object1 not sure on [0,2,0] could be -2 have a mess with it sry to correct you but the right side should be [2,0,0] Remember [+EAST/-WEST , +NORTH/-SOUTH , +UP/-DOWN] :P Share this post Link to post Share on other sites
DBO_ 0 Posted November 18, 2007 Quote[/b] ]Remember [+EAST/-WEST , +NORTH/-SOUTH , +UP/-DOWN] it will be my next tattoo thanks for correcting Share this post Link to post Share on other sites
ColonelSandersLite 0 Posted November 19, 2007 Easiest way to remember that for me goes like this: The origin ([0,0,0]) is sea level on the bottom left corner of the map. X is almost always left, right on a cartesian plane. That may or may not help you. Share this post Link to post Share on other sites
Junker 0 Posted November 20, 2007 Easiest way to remember that for me goes like this:The origin ([0,0,0]) is sea level on the bottom left corner of the map. X is almost always left, right on a cartesian plane. That may or may not help you. i got lost at sea level Share this post Link to post Share on other sites