# 3D World coords to on-screen coords in an ancient engine

I've been googling for past 2 hours and I couldn't find a satisfying solution that wouldn't require you to use Unity, OpenGL or Unreal Engine.

My issue is, I was given a task to make a game on an ancient 3D engine built purely from scratch (no OpenGL etc.).

The task I was given is - draw text above every chest the player can see.

In OpenGL I would do a simple transformation seeing how I've got all what I need built in, but in here I have to do the math myself.

The game from top-down looks like this:

Hearts represent chestboxes, the rest is marked.

So here's what I know for sure that might be useful:

• I know XYZ positions of these hearts
• I know the maximum angle after which chest disappears fully from my sight is -32.5 for the left edge and 32.5 for the right screen edge - which made me conclude that FOV is 75.
• The game window (viewport dimensions) is 1024x768
• I can calculate pitch/yaw easily for any two vectors, be it player->camera, player->chest, camera->chest etc.

What I don't know is - where do I go from there?

Any help appreciated, thanks!

PS: The language I'm allowed to write in is C#, but I'm only looking for help with formula so.