I'm trying to map cartesian coordinates to a 2D screen. But it's for a game, and I only have limited resources to find maths related to the screen. I've googled for help, but most require a camera position, and there is no function to determine that in the game. I can return the camera's X, Y and Z world rotation anges. I can return an angle between the camera and a certain object. Using only thjose two things, what would be the formula to map a 3D position to a 2D screen?
I've found and used a simple formula:
screenX = cartX + screen_width/2
screenY = screen_height/2 - cartY
But that dopesn't factor the camera into the equation. But all I can return is what I've stated above. Please help.
Thanks.
I've found and used a simple formula:
screenX = cartX + screen_width/2
screenY = screen_height/2 - cartY
But that dopesn't factor the camera into the equation. But all I can return is what I've stated above. Please help.
Thanks.