HUD in 3D environment

Apr 23, 2013 at 6:57am

HUD in 3D environment

I’m building several games in Max/Jitter right now and I have already created the FPS-style navigation in a 3D environment with physics etc. Now I am looking to create the heads-up-display for showing health, a map etc. What I need is the ability to render text/jpg/shapes to a 2D plane that is unaffected by the camera rotation and 3D movement already present in the game. Is there an attribute of the jit.gl.text2d or jit.gl.videoplane objects that I can use to achieve this? Maybe rendering as matrices and using a jit.op to combine? Any and all assistance appreciated. I’m sure I’m missing something simple.

#67889
Apr 23, 2013 at 10:08am

In my opinion a good option is to create second rendering context (this context will be containing your HUD visuals), add atribute @shared 1 to booth main and second rendering context, render second context to texture ([it.gl.node] with @capture 1 parameter is good for that), and display the texture on a plane in first (main) context.

#244099
Apr 23, 2013 at 8:33pm

I’m a bit confused by that last bit. If I display the texture on a plane in the main context it will still need a position and rotation in 3D space. Essentially, I need a way to treat the window as the plane. Is this what worldtoscreen is for?

#244100
Apr 23, 2013 at 8:41pm

see my reply here:

http://cycling74.com/forums/topic.php?id=46601

best bet is to start patching something. if you get stuck post what you’ve got back here.

#244101

You must be logged in to reply to this topic.