문제

I'm trying to mark a model that is moving in 3D on my 2D screen, I have position of both objects in 3D and they only move along the x and z axis so Y isn't an issue here.

Since I can't explain this that well I drew 3 pictures.
The one in the top right is the information I have, the middle left is an example of what they would look like looking down on the x z axis and the bottom one is what I'm trying to accomplish, putting some indicator around the position of the players.
Example

If anyone knows the formulas for doing this or links to an example, that'd be great. Thanks :)

도움이 되었습니까?

해결책

Turns out it is a lot easier than you'd think. All you have to do is Camera.project(Vector3) and that returns a vector3 you can get the x and y from.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top