j-rewerts / min3d

Automatically exported from code.google.com/p/min3d
0 stars 0 forks source link

min3d HUD #24

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Is there any way to add a HUD to the view? i.e. add some 3D objects as an 
overlay to show things like the current score, buttons for moving, etc, and 
that aren't affected by moving/rotating the camera.

The code would be pretty similar to what's referenced here (this is iPhone but 
the port is very easy):

http://iphonedevelopment.blogspot.com/2010/02/drawing-hud-display-in-opengl-es.h
tml

From the looks of it I would need to change the min3d code to access the parts 
I need to do this. I'm ok to do this, but ideally there would be a min3d hook 
in for this so I either just override a drawHud() method in my RendererActivity 
or maybe have a branch of the scene tree that allows us to add objects to it 
that are drawn in ortho view.

Happy to lend whatever assistance I can if needed.

Original issue reported on code.google.com by zonski on 13 Dec 2010 at 2:33

GoogleCodeExporter commented 9 years ago
I've implemented a basic version of this by:

1. Adding a List<Object3d> _hudElements to Scene (with accessors)
2. Adding a drawHud() method to Renderer, which is called by onDrawFrame()

To add a HUD I then add elements to the hudElements array in my initScene code. 

See attached files for more detail. 

I will probably extend this to hook up onTouch so that it processes the 
elements in the hudElements array for taps and calls back onto the handler 
(i.e. a crude 3D widget set). I'll do this for my own usage. If you want me to 
contribute this back to the source tree let me know.  

Original comment by zonski on 13 Dec 2010 at 11:08

Attachments:

GoogleCodeExporter commented 9 years ago
Zonski, thanks very much for this. Apologies for the delay. 

Let me think about how I want to handle this -- either as a dedicated "HUD" 
like you've posted, or maybe an array of "scene layers", with options for 
perspective versus orthographic?

BTW, how are you going to/did you handle touch events on the 3D objects in your 
HUD?

Original comment by l...@felar.ca on 21 Feb 2011 at 5:43

GoogleCodeExporter commented 9 years ago
This is a very important feature. Has it been decided upon? Right now I see no 
way of drawing HUD, especially since the custom renderer interface isn't done 
yet.

The only non-intrusive way I can imagine is drawing a rectangle in front of the 
camera and displaying HUD yourself. Not nice at all...

Original comment by Cezary.K...@gmail.com on 31 May 2011 at 2:39

GoogleCodeExporter commented 9 years ago
Dear Zwolenski

   I am developing my project using this framework(min3d). Now i need to implement the onTouch event on 3d model .I read your comment . Can tell me your logic is working  , if yes ! can u please explane it once . and what modification i have to do.

regards
ashutosh

Original comment by ashun...@gmail.com on 14 May 2012 at 7:10