Browsing Wiremod's section
← Back to ACE
💬

Community answer

Collected from the ACE community Discord archive around 2022-09-24. It may be informal or outdated — anyone can edit this page to improve it. This topic changes between game versions — double-check before relying on it. Original discussion

Projecting 3D HUD elements onto a 2D screen

💻 Expression 2Updated 2 days ago•0 views
Translate world positions to screenspace: Vector:toScreen gives screen coords, or do a plane-line intersection (PLI) of the eye ray onto the screen plane - pli(…

How to display 3D HUD elements (like an aircraft HUD) on a 2D SF screen

Translate world positions to screenspace: Vector:toScreen gives screen coords, or do a plane-line intersection (PLI) of the eye ray onto the screen plane - pli(eyePos, target-eyePos, screenPos, screenUp) - then convert the local position using the resolution factor from render.getScreenInfo and bounds-check. Use stencil masks/scissorrect to clip to the screen window.

Was this article helpful?

See More

Discussion(0)

No comments yet. Be the first to ask a question!

Have a question? Sign in to join the discussion.