Java Reference
In-Depth Information
sgbuttonTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
sgbuttonTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
sgbuttonTrans.setCapability(TransformGroup.ALLOW_PICKABLE_READ);
sgbuttonTrans.setCapability(TransformGroup.ALLOW_PICKABLE_WRITE);
sgbuttonTrans.setCapability(TransformGroup.ENABLE_PICK_REPORTING);
setPosition(sgbuttonTrans, sg_buttonposi[j]);
sgbuttonTrans.addChild(sg_button[j]);
sgTrans.addChild(sgbuttonTrans);
}
Shape3D sg_screen = new Screen3D(0.005f, 0.18f, 0.07f, dis_look);
TransformGroup sgscreenTrans = new TransformGroup();
sgscreenTrans.setCapability(Group.ALLOW_CHILDREN_WRITE);
sgscreenTrans.setCapability(Group.ALLOW_CHILDREN_EXTEND);
setPosition(sgscreenTrans, new Point3f(-0.18f*sg_width, 0.18f*sg_height,
0.5f*sg_length+0.005f));
sgscreenTrans.addChild(sg_screen);
sgTrans.addChild(sgscreenTrans);
// Create a circuit board -------------------------------------------------------------//
Transform3D t3d = new Transform3D();
TransformGroup ccTrans = new TransformGroup();
TransformGroup objScale = new TransformGroup();
t3d.setScale(0.1);
t3d.setTranslation(new Vector3d(0.67, 1.17, -4.04));
objScale.setTransform(t3d);
objRoot.addChild(ccTrans);
ccTrans.addChild(objScale);
VrmlLoader f = new VrmlLoader();
Scene s = null;
try {
s = f.load(cir_board);
}
catch (FileNotFoundException e) {
System.err.println(e);
System.exit(1);
}
catch (ParsingErrorException e) {
System.err.println(e);
System.exit(1);
}
catch (IncorrectFormatException e) {
System.err.println(e);
System.exit(1);
}
s.getSceneGroup().setPickable(false);
objScale.addChild(s.getSceneGroup());
Search WWH ::




Custom Search