Hi,
I tried a pick method to select my Max model using ths code:
BoundingPickResults pr;
Geometry pickedModel;
pr = new BoundingPickResults();
if (MouseInput.get().isButtonDown(0)) {
Vector2f screenPos = new Vector2f();
screenPos.set(am.getHotSpotPosition().x, am.getHotSpotPosition().y);
Vector3f worldCoords = display.getWorldCoordinates(screenPos, 0);
Vector3f worldCoords2 = display.getWorldCoordinates(screenPos, 1);
Ray mouseRay = new Ray(worldCoords, worldCoords2.subtractLocal(
worldCoords).normalizeLocal());
pr.clear();
rootNode.findPick(mouseRay, pr);
if (pr.getNumber()>0) {
pickedModel = pr.getPickData(0).getTargetMesh();
System.out.println(pickedModel.getName());
}
}
but all I get from pickedModel is the bounding box of the Max model, but I do need access to the name of the actual model the box is bounding.
Any one know how to do it ?