Package javax.media.j3d

Examples of javax.media.j3d.TransformGroup


    BranchGroup objRoot = scene.getBranchgroup();

    Appearance a = new Appearance();
    a.setPolygonAttributes(new PolygonAttributes(PolygonAttributes.POLYGON_LINE, PolygonAttributes.CULL_NONE, 0));
    TransformGroup sphereTrans = new TransformGroup();
    sphereTrans.addChild(new Sphere(1.f, Sphere.GENERATE_NORMALS,40, a));

    scene.detach();
    objRoot.setCapability(BranchGroup.ALLOW_CHILDREN_EXTEND);
    objRoot.addChild(sphereTrans);
View Full Code Here


        BranchGroup objRoot = new BranchGroup();
        // Create the TransformGroup node and initialize it to the
        // identity. Enable the TRANSFORM_WRITE capability so that
        // our behavior code can modify it at run time. Add it to
        // the root of the subgraph.
        TransformGroup objTrans = new TransformGroup();
        Transform3D t3dTrans = new Transform3D();
        objTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
        objTrans.setTransform(t3dTrans);
        objRoot.addChild(objTrans);
        BoundingSphere bounds = new BoundingSphere(new Point3d(0.0, 0.0, 0.0),
                100.0);
        // Set up the ambient light
        Color3f ambientColor = new Color3f(0.3f, 0.3f, 0.3f);
View Full Code Here

   * to hold the shape defined by the data in the file.
   * A transformation will then be applied to scale and center the shape. 
   */
  public XYZResultNodeJava3D(ActiveNode parent) {
    super(parent);
        transformGroup = new TransformGroup();
        transformGroup.setUserData(this);
        transformGroup.setPickable(true);
        transformGroup.setCapability(TransformGroup.ALLOW_BOUNDS_READ);
        transformGroup.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
        transformGroup.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
View Full Code Here

 
  protected transient TransformGroup transformGroup;
   
  public TransformGroupNodeJava3D(ActiveNode parent) {
    super(parent);
    transformGroup = new TransformGroup();
    transformGroup.setUserData(this);
    transformGroup.setPickable(true);
    transformGroup.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
    transformGroup.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
    SceneNodeJava3D.addChildToParentGroup((Group)getParent().get3DObject(), transformGroup);
View Full Code Here

   
   
   
    private void readObject(java.io.ObjectInputStream in) throws java.lang.ClassNotFoundException, java.io.IOException {
      in.defaultReadObject();
      transformGroup = new TransformGroup();
      transformGroup.setUserData(this);
      transformGroup.setPickable(true);
      transformGroup.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
      transformGroup.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
    }
View Full Code Here

 
 
  // Composed transformation
  public TransformDataJava3d( TransformGroupNode node, TransformData transformRoot) {
    super(node, transformRoot);
    this.group = new TransformGroup();
    init();
  }
View Full Code Here

  }
 
  public void restoreTransform(TransformGroupNode node, TransformData transformRoot){
    super.restoreTransform(node, transformRoot);
   
    this.group = new TransformGroup();
    trans = new Transform3D();
    group.getTransform(trans);
    updateTransform();
    group.setTransform(trans);
    if (node!=null) node.setDirty();
View Full Code Here

        @Override
        public void actionPerformed(ActionEvent e) {
           
            GroupNode gn=(GroupNode)getNode();
           
            TransformGroup g=new TransformGroup();
            // TODO i18n
            g.setName("SolidFrame");
           
            Transform3D nz=new Transform3D();
            nz.rotZ(-Math.PI/2.);
            TransformGroup tgx=new TransformGroup(nz);
            tgx.setName("X");           
            makeSolidAxis(tgx, 1.f, 0.04f, 0.02f, 0.04f, Color.RED, Color.RED, 10);           
            g.addChild(tgx);

            TransformGroup tgy=new TransformGroup(new Transform3D());
            tgy.setName("Y");           
            makeSolidAxis(tgy, 1.f, 0.04f, 0.02f, 0.04f, Color.GREEN, Color.GREEN, 10);           
            g.addChild(tgy);
           
            Transform3D px=new Transform3D();
            px.rotX(Math.PI/2.);
            TransformGroup tgz=new TransformGroup(px);
            tgz.setName("Z");           
            makeSolidAxis(tgz, 1.f, 0.04f, 0.02f, 0.04f, Color.BLUE, Color.BLUE, 10);           
            g.addChild(tgz);

            gn.addChild(g);
           
View Full Code Here

                    getLocation(),"Axis"); // TODO i18n
            AxisDialog.Result n=d.getResult();
            if(n!=null){
                GroupNode gn=(GroupNode)getNode();
       
                TransformGroup g=new TransformGroup();
                // TODO i18n
                g.setName("Axis");
       
                makeSolidAxis(g, n.height, n.arrowHeight, n.radius, n.arrowRadius, Color.WHITE, Color.WHITE, n.divisions);           

                gn.addChild(g);
       
View Full Code Here

    static class AddTransformGroupAction extends AbstractNodeAction {
        // required for dynamic action creation
        public AddTransformGroupAction() {
        }
        public void actionPerformed(ActionEvent e) {
            ((GroupNode)getNode()).addChildUndoable(new TransformGroup());
            getNode().refresh();
        }
View Full Code Here

TOP

Related Classes of javax.media.j3d.TransformGroup

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.