Home Game Development c# – Converting from global coordinates to local coordinates

c# – Converting from global coordinates to local coordinates

0
c# – Converting from global coordinates to local coordinates

[ad_1]

I am trying to create a Radar/Minimap for the F1 2021 game in C#/WPF. Here is a image of what I am trying to replicate

radar

In the image, the white car (my car) will always face the direction it is going. The blue car (other play car) will face relative to my direction.

I am given the following information

public float m_worldPositionX;           // World space X position
public float m_worldPositionY;           // World space Y position
public float m_worldPositionZ;           // World space Z position
public float m_worldVelocityX;           // Velocity in world space X
public float m_worldVelocityY;           // Velocity in world space Y
public float m_worldVelocityZ;           // Velocity in world space Z
public short m_worldForwardDirX;         // World space forward X direction (normalised)
public short m_worldForwardDirY;         // World space forward Y direction (normalised)
public short m_worldForwardDirZ;         // World space forward Z direction (normalised)
public short m_worldRightDirX;           // World space right X direction (normalised)
public short m_worldRightDirY;           // World space right Y direction (normalised)
public short m_worldRightDirZ;           // World space right Z direction (normalised)
public float m_gForceLateral;            // Lateral G-Force component
public float m_gForceLongitudinal;       // Longitudinal G-Force component
public float m_gForceVertical;           // Vertical G-Force component
public float m_yaw;                      // Yaw angle in radians
public float m_pitch;                    // Pitch angle in radians
public float m_roll;                     // Roll angle in radians

I am having trouble understanding the concept of worldForwardDir and worldRightDir, and how they differ.

Furthermore, I am wondering if it is even possible at all given the information above that I can transform the worldPosition coordinates into something usable by a 2D canvas.

[ad_2]