Hello Again,
To make things short, is Mouse Picking possible in HUDs?
I have research this topic in the forums and try implementing it different ways including PickResults, trying to add a boundingSphere and boundingVolume and still no luck with mouse picking.
In the HUD, there is the fps Node, a tooltip Node that displays the name of the object the mouse is currently rolling over, and finally there is a navigation compass as you can see in the image below.
I want the mouse to detect whenever the mouse is inside the HUD and more specifically over the compass, and the way I’m doing this right now is checking the mouse coordinates against the position of the compass. My compass is made of two textures that are then added to two different quads which are then added to a Node, and finally this node is added to the HUD. PickResults works great on picking objects that are on the scene, but doesn’t work at all when detecting objects from the HUD. Is there a way for PickResults to detect objects within the HUD? Ideally I would like to use the mouse to click on the compass to move the camera around the scene, pretty much like the Compass in GoogleEarth.
And on another topic, my HUD only seems to be visible when I’m a certain distance away from the objects in the scene. If I move the camera far away from the scene the HUD disappears. Is there a way around this?
Thanks for your help,
– jrmartin.
P.S. Thanks Starnick, nymon, and basixs for your replies in my previous post. http://www.jmonkeyengine.com/jmeforum/index.php?topic=10888.0 which ideas are used in current implementation of the compass.
jrmartin said:
If I move the camera far away from the scene the HUD disappears. Is there a way around this?
Setting the cull hint of your HUD elements to never should help.
quad.setCullHint(CullHint.Never);