Hi All,
Does t0neg0d’s GUI support 3D interactivity? I know that Void’s Nifty-GUI can be placed upon a surface by tapping into the Texture2D set up for that GUI (well, giving it a frambuffer to play with), however, interaction coordinates are still in “screen space”.
If not, would either GUI project leader like some math/coding assistance for their GUI to expand into that capability?
I am working on my toolset for my game project Iteag, and I want a 3D-capable GUI for my game… I think an in-game interactive holographic looking panel would be cool. (It would be the transparency pass that ignores writing to the z-buffer, or one of the last passes to a Texture2D…(ack! FrameBuffer!) in deferred rendering)
The basics for me to do this by myself would be to (rough algorithm time)
Create the object:
create a Texture2D/Framebuffer of “arbitrary size” for the GUI or GUI element
create a node (for ease of transforming all child data positional coordinates if it moves)
attach a Quad geometry (spatial, I believe?)
attach a UV-enabled material (verts and frags shaders/opengl) for rendering
attach the Texture2D of “arbitrary size” (I understand UV co-ords as a multiplier )
attach a sound source to it. (It could beep n stuff)
attach a collision detection plane (unless it’s non interactive)
Attach to rootnode, and manipulate
An assumption:
a listening source is attached to camera or “player” so that any soundfx attached to object scale properly to distance from sound source.
Detect the object:
do a raycast from mouse(viewport space) to collision(world space) only when mouse moves or clicks.
convert from world space to local space to find UV coordinates of collision(the multiplier for width/height of Texture2D);
…and there’s the X,Y cords.
Interaction with object:
2DGUI interaction from there with bells and whistles. It’s 2D stuff now.
rebind Processed Texture2D to gpu for that material, unless that’s already in code. In jMonkeyEngine, the usage of the FrameBuffers class makes a great go between, I believe. (Me <- still a noob)
Some cool implications (if done right, of course):
-A truly scaleable GUI that is independent of resolution, for that would be configured by the Texture2D/Framebuffer. The quad geometry is created to match the aspect/ratio of the texture.
-Multiple Quads could be attached to a .j3o “scene” for a truly 3d layered gui. the node would allow it to be “billboarded” to the camera.
-The Multiple Quads setup would look 2D on an orthographic view(facing the camera)… I only mention this because an editing tool with the 3d layered look would be awesome to use… even if the end result is for a 2D singular layer and you are just specifying rendering order… LOL… EDITOR!
-I gets my hologram panel of “awesomness”.
Ok, that about covers it. I’ve probably posted in the wrong part of the forum…though. Ah well.
Game On,
Charles Anderson