Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

kaffekopp

macrumors newbie
Original poster
Aug 29, 2008
1
0
I have made a little java3d program. This was made on a PC (working fine there). Now i want to use the program on Mac aswell, the problem is that object picking using PickCanvas doesnt seem to work here.
(PickCanvas is located in j3dutils.jar -> com.sun.j3d.utils.picking.PickCanvas)

My mouseclick/picking method looks something like this:

public void mouseClicked(MouseEvent event) {
if ((event.getModifiers() & InputEvent.BUTTON1_MASK) != 0){
// Left mousebutton clicked:
pickCanvas.setShapeLocation(event);
PickResult result = pickCanvas.pickClosest();

if (result != null) {
// A 3D object has been mouseclicked
Primitive prim = (Primitive) result.getNode(PickResult.PRIMITIVE);

//...
}
}
}

On PC\windows the program detects a PickResult when I click on a 3d object, no problem there. But on Mac, the variable "result" is always "null" when i click on a 3d object.. why?


Need help! :confused:
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.