Hi,
I want to know how to calculate if the Position of an object is to the left or right relative to another object.
Thanks for your replies.
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
Hi,
I want to know how to calculate if the Position of an object is to the left or right relative to another object.
Thanks for your replies.
I can be easy or tough, it depends on how you rotate the objects. If you have smooth rotations you need more than trivial math ( matrices, angles, pi). but if you have like four positions (facing N, S , E, W) you just need simple positions substracting
Thanks for the reply. I want to rotate an object towards another object. If the target object is on the left side relative to the other object the object should rotate clockwise towards the target object. If it is on the right side relative to the other object the object should rotate counter clockwise.
I have included a picture to help explain what i mean.
I c what you`re saying. Basically if we refer strictly to the situation you depicted
if(RO.x > TO.x) TO object to the left
if(RO.x < TO.x) TO object to the right
Get direction of object relative to another object… say
vector dir = objwhichSide.posiition - obj_reference.position
get rightVector of obj_reference…
if rightVector (dotproduct) dir == -1 object is at left
if rightVector (dotproduct) dir == 1 object is at right
Enzio599 said:
why two threads for same query…….
happened to me too, the software is a bit confusing.