app.setPolygonAttributes(pa); sh.setGeometry(lsa); sh.setAppearance(app); sh.setPickable(true); TransformGroup objRotate = new TransformGroup();
app.setMaterial(mat); app.setPolygonAttributes(pa); sh.setAppearance(app); sh.setPickable(true); GeometryArray ga=null;
/** Sets appearance of the Sphere. */ @Override public void setAppearance(Appearance ap) { // ((Shape3D)((Group)getChild(0)).getChild(BODY)).setAppearance(ap); ((Shape3D)getChild(BODY)).setAppearance(ap); }
/** * Sets appearance of the cone. This will set each part of the * cone (cap & body) to the same appearance. To set each * part's appearance separately, use getShape(partId) to get the * individual shape and call shape.setAppearance(ap). */ @Override public void setAppearance(Appearance ap){ ((Shape3D)getChild(BODY)).setAppearance(ap); ((Shape3D)getChild(CAP)).setAppearance(ap); }
/** Sets appearance of the cylinder. This will set each part of the * cylinder (TOP,BOTTOM,BODY) to the same appearance. To set each * part's appearance separately, use getShape(partId) to get the * individual shape and call shape.setAppearance(ap). */ @Override public void setAppearance(Appearance ap) { ((Shape3D)getChild(BODY)).setAppearance(ap); ((Shape3D)getChild(TOP)).setAppearance(ap); ((Shape3D)getChild(BOTTOM)).setAppearance(ap); }
/** Sets the main appearance of the primitive (all subparts) to * same appearance. */ public abstract void setAppearance(Appearance ap);
/** * Sets appearance of the box. This will set each face of the * box to the same appearance. To set each face's appearance * separately, use getShape(partId) to get the * individual shape and call shape.setAppearance(ap). */ @Override public void setAppearance(Appearance ap){ // ((Shape3D)((Group)getChild(0)).getChild(TOP)).setAppearance(ap); // ((Shape3D)((Group)getChild(0)).getChild(LEFT)).setAppearance(ap); // ((Shape3D)((Group)getChild(0)).getChild(RIGHT)).setAppearance(ap); // ((Shape3D)((Group)getChild(0)).getChild(FRONT)).setAppearance(ap); // ((Shape3D)((Group)getChild(0)).getChild(BACK)).setAppearance(ap); // ((Shape3D)((Group)getChild(0)).getChild(BOTTOM)).setAppearance(ap); ((Shape3D)getChild(TOP)).setAppearance(ap); ((Shape3D)getChild(LEFT)).setAppearance(ap); ((Shape3D)getChild(RIGHT)).setAppearance(ap); ((Shape3D)getChild(FRONT)).setAppearance(ap); ((Shape3D)getChild(BACK)).setAppearance(ap); ((Shape3D)getChild(BOTTOM)).setAppearance(ap); }
public void enableTextures() { final int[] size = new int[] { volume.xDim, volume.yDim, volume.zDim }; for (int axis = 0; axis < 3; axis++) { for (int i = 0; i < size[axis]; i++) { final Appearance app = appCreator.getAppearance(axis, i); final Group frontGroup = (Group) axisSwitch.getChild(axisIndex[axis][FRONT]); ((Shape3D) ((Group) frontGroup.getChild(i)).getChild(0)) .setAppearance(app); final Group backGroup = (Group) axisSwitch.getChild(axisIndex[axis][BACK]); ((Shape3D) ((Group) backGroup.getChild(size[axis] - i - 1)).getChild(0)) .setAppearance(app); } } }
public void disableTextures() { final int[] size = new int[] { volume.xDim, volume.yDim, volume.zDim }; final Appearance empty = new Appearance(); for (int axis = 0; axis < 3; axis++) { for (int i = 0; i < size[axis]; i++) { final Group frontGroup = (Group) axisSwitch.getChild(axisIndex[axis][FRONT]); final Group backGroup = (Group) axisSwitch.getChild(axisIndex[axis][BACK]); final Appearance app = getAppearance(axis, i); app.getTextureUnitState(0).setTexture(null); ((Shape3D) ((Group) frontGroup.getChild(i)).getChild(0)) .setAppearance(empty); ((Shape3D) ((Group) backGroup.getChild(i)).getChild(0)) .setAppearance(empty); } } }
@Override public void buildGraph() { ((Shape3D)node).setAppearance( (Appearance)control.getSymbolTable().getJ3dNode( appearance ) ); ((Shape3D)node).setGeometry( (Geometry)control.getSymbolTable().getJ3dNode( geometry[0] ) ); for(int i=1; i<geometry.length; i++) { ((Shape3D)node).addGeometry( (Geometry)control.getSymbolTable().getJ3dNode( geometry[i] ) ); } super.buildGraph(); // Must be last call in method }
shape.addGeometry(makeLine(p[3], p[7], c, td, 0f, ts, true)); shape.setAppearance(createAppearance(color)); addChild(shape);
objectShape.setAppearance(appearance); objectShapeList.addElement(objectShape);