Package syn3d.nodes.java3d

Examples of syn3d.nodes.java3d.SceneNodeJava3D$Java3DPlugin3DFileFilter


    super(scene, t, x, y, width, height,pm);
    this.scene = scene;
  }
   
  protected void createPeer(Object owner){
      SceneNodeJava3D scene = (SceneNodeJava3D)owner;
    canvas = scene.getCanvas3D();

    frame=new JFrame(SimpleUniverse.getPreferredConfiguration());
    frame.getContentPane().setLayout(new BorderLayout());
    frame.setLocation(x, y);
    frame.setSize(width,height);
    frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
    frame.getContentPane().add("Center", canvas);
   
    peerComponent=frame;
    peerWindow=frame; 

    transform=new Transform3D();
    // avoids cumulative rounding errors
    // This should avoid "non-congruent transform above view transform" exception
    // Warning: In some cases, this exception still appears. This is a known J3D bug, that
    // should hopefully be corrected in J3D v1.4
    transform.setAutoNormalize(true);
    tempTransform=new Transform3D();
   
    viewingPlatform = scene.getUniverse().getViewingPlatform();
   
    viewer = viewingPlatform.getViewers()[0];
    view = viewer.getView();
    // Use J3D recommendation to set this between 100 and 1000
    // default is a factor of 100 (front=0.1, back=10)
View Full Code Here


   */
  public static void main(String[] args) {
     
   
    PluginManager pluginManager = (PluginManager) new Java3DPluginManager();
      SceneNodeJava3D scene = new SceneNodeJava3D(null, pluginManager);
     
   
    //BoundingSphere bs = new BoundingSphere(//universe bounds
    //        new Point3d(0.0, 0.0, 0.0), 1000.0);
    //PlatformGeometry pg = new PlatformGeometry();
    //Color3f ac = new Color3f(0.2f, 0.2f, 0.2f);
    //AmbientLight al = new AmbientLight(ac);
    //al.setInfluencingBounds(bs);
    //pg.addChild(al);
    //f1.viewingPlatform.setPlatformGeometry(pg);
    // TODO check where to add the light
    //f1.viewingPlatform.setNominalViewingTransform();

    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);

    AmbientLight aLgt = new AmbientLight(new Color3f(0.2f, 0.2f, 0.2f));
    objRoot.addChild(aLgt);
   
    scene.attach();
  }
View Full Code Here

     
      if (node.equals(NodeResourcesManager.getResources().getString("Builder")))
        return new BuilderNodeJava3D(parent, pluginManager);
     
      if (node.equals(NodeResourcesManager.getResources().getString("Scene")))
        return new SceneNodeJava3D(parent, pluginManager);
     
      else if (node.equals(NodeResourcesManager.getResources().getString("BranchGroup")))
        return new BranchGroupNodeJava3D(parent);
     
     
View Full Code Here

TOP

Related Classes of syn3d.nodes.java3d.SceneNodeJava3D$Java3DPlugin3DFileFilter

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.