# Finding loss of angle and length due to rotation

I'm working on a targeting system for my 2d game. But I want to see the object in isometric perspective. My calculation is correct for 2d objects but it doesn't work for rotated in x axis objects.

I want to see yellow line which is rotated in x axis to look towards directly to red circle in 2d orthographic camera. I need to calculate angle between yellow and white lines and loss of length due to rotation.

private void OnDrawGizmos()
{
var isometricAngle = math.radians(54.736f);
var difference = _target.position - _source.position;
var whiteLineDirection = difference.normalized;
var yellowLineDirection = math.mul(quaternion.Euler(isometricAngle, 0, 0), whiteLineDirection);
var distance = difference.magnitude;
Gizmos.color = Color.white;
Gizmos.DrawRay(_source.position, whiteLineDirection * distance);
Gizmos.color = Color.yellow;
Gizmos.DrawRay(_source.position, yellowLineDirection * distance);
}
• green circle: player with rotation in eular(0, 0, 0)
• yellow line: effect with rotation in eular(54.736, 0, 0)
• white line: debug line with rotation in eular(0, 0, 0)
• red circle: enemy with rotation in eular(0, 0, 0)

• Could you add a bit more description on what you want to achieve? Right now the question doesn't even contain a "question" sentence. Sep 8, 2023 at 6:34
• Sorry for the bad explanation. I hope it's clear now Sep 8, 2023 at 7:33
• My usual approach would be to store and manipulate all objects in orthogonal and non-foreshortened world coordinates, then apply the isometric perspective in the conversion to screen space (e.g. via the Camera in Unity). This separation of the underlying behaviour model from the particulars of the view/representation helps simplify a lot of systems. Sep 8, 2023 at 21:44
• Thank you for your comment. That approach is not bad but unfortunately, I can't use in my case. Sep 9, 2023 at 8:21