Hello all,
I wrote a class for my picking application. I have a tabbed pane with 3
tabs and on each tab I have different canvasses. I want my code select
objects from one of the canvas. So I pass one of the canvas name in my
code. But in reality, the code selects the objects on all of the
canvasses. What is the reason for this? How can I correct this?
Thanks for any help.
//MY CODE
public class MousePickBehaviour extends MouseClickedBehaviour
{
PickRay ray = createPickRay(canvas_vr, x, y);
SceneGraphPath sgp = Solid.pickClosest(ray);
//number of objects in spg returns 1
if (sgp!=null)
{
Node object = sgp.getObject();
...// rest of the code
}
private PickRay createPickRay(Canvas3D canvas_vr, int x, int y)
{
Point3d eye_pos = new Point3d();
Point3d mouse_pos = new Point3d();
canvas_vr.getCenterEyeInImagePlate(eye_pos);
canvas_vr.getPixelLocationInImagePlate(x, y, mouse_pos);
Transform3D motion = new Transform3D();
canvas_vr.getImagePlateToVworld(motion);
motion.transform(eye_pos);
motion.transform(mouse_pos);
Vector3d direction = new Vector3d(mouse_pos);
direction.sub(eye_pos);
return new PickRay(eye_pos, direction);
}
}
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".