Hi,
I’d want to have three selectable objs in my jpct’s scene applet and I need, when I do a mouse’s click on one of these, that some text appears, for example showing his id, on the applet area.
I’ve read the Selection Mode thread where you’ve posted the following code:
SimpleVector ray=Interact2D.reproject2D3D(camera, buffer, mouseX, mouseY);
int[] res=Interact2D.pickPolygon(theWorld.getVisibilityList(), ray);
if (res!=null) {
Object3D pickedObj=theWorld.getObject(Interact2D.getObjectID(res));
}
I’ve made my objs selectable using the following code:
ferito1.setSelectable(ferito1.MOUSE_SELECTABLE); (where ferito1 is an Object3D).
First question: mouseX, mouseY should contain the x,y value of the mouse on the applet area; I guess I’ve to get these values, isn’t so? If it’s so, using which method?
Second question: pickedObj contains the obj that I’ve selected by a mouse’s click? If it’s so, using the method, getID(), I get this obj’s id?
Bye and thanks