lsa.setNormals(0, normals); lsa.setCoordinates(0, pts); Shape3D sh=new Shape3D(); PolygonAttributes pa=new PolygonAttributes(); pa.setPolygonMode(PolygonAttributes.POLYGON_FILL);
pts[23].x=0.5f;pts[23].y=0.5f;pts[23].z=-0.5f; normals[20].y=1;normals[21].y=1;normals[22].y=1;normals[23].y=1; Shape3D sh=new Shape3D(); PolygonAttributes pa=new PolygonAttributes(); pa.setPolygonMode(PolygonAttributes.POLYGON_FILL);
@Override protected org.scijava.java3d.SceneGraphObject createNode() { return new Shape3D(); }
/** * Used to create a new instance of the node. This routine is called * by <code>cloneTree</code> to duplicate the current node. * <code>cloneNode</code> should be overridden by any user subclassed * objects. All subclasses must have their <code>cloneNode</code> * method consist of the following lines: * <P><blockquote><pre> * public Node cloneNode(boolean forceDuplicate) { * UserSubClass usc = new UserSubClass(); * usc.duplicateNode(this, forceDuplicate); * return usc; * } * </pre></blockquote> * @param forceDuplicate when set to <code>true</code>, causes the * <code>duplicateOnCloneTree</code> flag to be ignored. When * <code>false</code>, the value of each node's * <code>duplicateOnCloneTree</code> variable determines whether * NodeComponent data is duplicated or copied. * * @see Node#cloneTree * @see Node#duplicateNode * @see NodeComponent#setDuplicateOnCloneTree */ @Override public Node cloneNode(boolean forceDuplicate) { Shape3D s = new Shape3D(); s.duplicateNode(this, forceDuplicate); return s; }
public Shape3D createShape() { Shape3D shape = new Shape3D( createGeometry(), createAppearance()); return shape; }
public Shape3D createShape() { Shape3D shape = new Shape3D( createGeometry(), createAppearance()); return shape; }
public ShapeGroup duplicate() { final ShapeGroup ret = new ShapeGroup(); if (shape != null) { ret.shape = new Shape3D(shape.getGeometry(), shape.getAppearance()); ret.group.addChild(ret.shape); } ret.pos = pos; return ret; } }
TriangleArray ta = vlist.toTriangleArray() ; if (ta != null) shapes.add(new Shape3D(ta, a)) ; break ; case TRI_STRIP_SET: TriangleStripArray tsa = vlist.toTriangleStripArray() ; if (tsa != null) shapes.add(new Shape3D(tsa, a)) ; break ; case TRI_STRIP_AND_FAN_SET: GeometryStripArray gsa[] = vlist.toStripAndFanArrays() ; if (gsa[0] != null) shapes.add(new Shape3D(gsa[0], a)) ; if (gsa[1] != null) shapes.add(new Shape3D(gsa[1], a)) ; break ; case TRI_STRIP_AND_TRI_SET: GeometryArray ga[] = vlist.toStripAndTriangleArrays() ; if (ga[0] != null) shapes.add(new Shape3D(ga[0], a)) ; if (ga[1] != null) shapes.add(new Shape3D(ga[1], a)) ; break ; default: LineStripArray lsa = vlist.toLineStripArray() ; if (lsa != null) shapes.add(new Shape3D(lsa, a)) ; break ;
public void show(final CubeData cdata, final int index) { shape = new Shape3D(createGeometry(cdata, index), createAppearance(cdata, index)); child.addChild(shape); group.addChild(child); }
Shape3D plShape = new Shape3D(); int vIndex=-1; int k=0;
TriangleArray ta = vlist.toTriangleArray() ; if (ta != null) shapes.add(new Shape3D(ta, a)) ; break ; case TRI_STRIP_SET: TriangleStripArray tsa = vlist.toTriangleStripArray() ; if (tsa != null) shapes.add(new Shape3D(tsa, a)) ; break ; case TRI_STRIP_AND_FAN_SET: GeometryStripArray gsa[] = vlist.toStripAndFanArrays() ; if (gsa[0] != null) shapes.add(new Shape3D(gsa[0], a)) ; if (gsa[1] != null) shapes.add(new Shape3D(gsa[1], a)) ; break ; case TRI_STRIP_AND_TRI_SET: GeometryArray ga[] = vlist.toStripAndTriangleArrays() ; if (ga[0] != null) shapes.add(new Shape3D(ga[0], a)) ; if (ga[1] != null) shapes.add(new Shape3D(ga[1], a)) ; break ; default: LineStripArray lsa = vlist.toLineStripArray() ; if (lsa != null) shapes.add(new Shape3D(lsa, a)) ; break ;
trackSwitch.addChild( new Shape3D( line, appearance ) );
Shape3D shape = new Shape3D();
final Appearance a = appCreator.getAppearance(axis, index); final Shape3D frontShape = new Shape3D(quadArray, a); frontShape.setCapability(Shape3D.ALLOW_APPEARANCE_WRITE); frontShape.setCapability(Shape3D.ALLOW_APPEARANCE_READ); front.addChild(frontShapeGroup); final Shape3D backShape = new Shape3D(quadArray, a); backShape.setCapability(Shape3D.ALLOW_APPEARANCE_READ); backShape.setCapability(Shape3D.ALLOW_APPEARANCE_WRITE);
p[7] = new Point3f(min.x, max.y, min.z); final Shape3D shape = new Shape3D(); shape.setName("BB");
final Appearance a = appCreator.getAppearance(axis, i); final Shape3D frontShape = new Shape3D(quadArray, a); frontShape.setCapability(Shape3D.ALLOW_GEOMETRY_WRITE); frontShape.setCapability(Shape3D.ALLOW_APPEARANCE_WRITE); frontShapeGroup.addChild(frontShape); final Shape3D backShape = new Shape3D(quadArray, a); backShape.setCapability(Shape3D.ALLOW_GEOMETRY_WRITE); backShape.setCapability(Shape3D.ALLOW_APPEARANCE_READ);
setCapability(BranchGroup.ALLOW_DETACH); final Shape3D lines = new Shape3D(); lines.setGeometry(createGeometry()); addChild(lines);
public Scalebar(final float length) { final Transform3D position = new Transform3D(); positionTG = new TransformGroup(position); positionTG.setCapability(TransformGroup.ALLOW_TRANSFORM_READ); positionTG.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); addChild(positionTG); lineShape = new Shape3D(); lineShape.setGeometry(createLineGeometry()); lineShape.setCapability(Shape3D.ALLOW_GEOMETRY_WRITE); positionTG.addChild(lineShape); final Transform3D texttranslate = new Transform3D(); texttranslate.setTranslation(new Vector3f(length / 2, -length / 2, 0.0f)); textTG = new TransformGroup(texttranslate); textTG.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); positionTG.addChild(textTG); textShape = new OrientedShape3D(); textShape.setCapability(Shape3D.ALLOW_GEOMETRY_WRITE); textShape.setCapability(Shape3D.ALLOW_APPEARANCE_WRITE); textShape.setGeometry(createTextGeometry()); textShape.setAppearance(createTextAppearance()); textShape.setAlignmentAxis(0.0f, 1.0f, 0.0f); textTG.addChild(textShape); }
BranchGroup bg = new BranchGroup(); bg.setCapability(BranchGroup.ALLOW_DETACH); bg.addChild(new Shape3D(qa, app)); univ.getScene().addChild(bg);