Skip to main content
Tweeted twitter.com/#!/StackGameDev/status/485110103058968577
added 35 characters in body
Source Link
Aviv Cohn
  • 913
  • 2
  • 10
  • 26

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:

pictorial description of the same

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.

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:

pictorial description of the same

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?

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:

pictorial description of the same

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.

Removed unnecessary duplication. Clarified word order.
Source Link
Anko
  • 13.4k
  • 10
  • 55
  • 82

How todo I convert from the global coordinate space to a local space?

Let's say I haveGiven an entity named EntityA.EntityA, I want to define a local coordinate space, where the position of EntityAEntityA is the origin, it'sits heading vector is the X axis, and the normal of the heading vector is the Y axis.

For example:

enter image description herepictorial description of the same

ThenGiven their global coordinates, how do I want to be able to know whatfind the position of any otheranother entity is, in EntityA'sEntityA's local space.?

So forAn example, if in: EntityA's global space the position of EntityA is (50,50), and the positionthat of EntityBEntityB is (80,90) - I want to be able to know what. What is then the position of EntityB would beEntityB in EntityA'sEntityA's local space.

Thanks for your help?

How to convert from global space to local space?

Let's say I have an entity named EntityA. I want to define a local space, where the position of EntityA is the origin, it's heading vector is the X axis, and the normal of the heading vector is the Y axis.

For example:

enter image description here

Then, I want to be able to know what the position of any other entity is, in EntityA's local space.

So for example, if in global space the position of EntityA is (50,50), and the position of EntityB is (80,90) - I want to be able to know what the position of EntityB would be in EntityA's local space.

Thanks for your help

How do I convert from the global coordinate space to a local space?

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:

pictorial description of the same

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?

Source Link
Aviv Cohn
  • 913
  • 2
  • 10
  • 26

How to convert from global space to local space?

Let's say I have an entity named EntityA. I want to define a local space, where the position of EntityA is the origin, it's heading vector is the X axis, and the normal of the heading vector is the Y axis.

For example:

enter image description here

Then, I want to be able to know what the position of any other entity is, in EntityA's local space.

So for example, if in global space the position of EntityA is (50,50), and the position of EntityB is (80,90) - I want to be able to know what the position of EntityB would be in EntityA's local space.

Thanks for your help