Given an entity named EntityA
, I want to define a local coordinate space, where the position of EntityA
is the origin, its heading vector is the X axis, and the normal of the heading vector is the Y axis:
Given their global coordinates, how do I find the position of another entity in EntityA
's local space?
An example: EntityA
's global position is (50,50), and that of EntityB
is (80,90). What is then the position of EntityB
in EntityA
's local space?
EDIT: Please go easy on the math.