Package com.sun.j3d.loaders.objectfile

Examples of com.sun.j3d.loaders.objectfile.ObjectFile


  public static Scene obj2scene(String filename) {
    int flags = ObjectFile.RESIZE;
    if (!noTriangulate) flags |= ObjectFile.TRIANGULATE;
    if (!noStripify) flags |= ObjectFile.STRIPIFY;
     
    ObjectFile f =
      new ObjectFile(flags,
      (float)(creaseAngle * Math.PI / 180.0));
    Scene s = null;
    try {
      filename=fixFileName(filename);
      if(filename.startsWith("http://"))
        s=f.load(new java.net.URL(filename));
      else
        s = f.load(filename);
    }
    catch (Exception e) {
      Prolog3D.pp(e);
      return null;
    }
View Full Code Here


  {



    //Load an obj-file.
    ObjectFile f = new ObjectFile(ObjectFile.RESIZE);
    Scene s = null;

    try
    {
      s = f.load("./eas/miscellaneous/java3D/schiff.obj");
    }
    catch (Exception e)
    {
      System.out.println("File loading failed:" + e);
    }
View Full Code Here

    // In this method, the objects for the scene are generated and added to
    // the SimpleUniverse.
    public void createSceneGraph(SimpleUniverse su) {

        // Load an obj-file.
        ObjectFile f = new ObjectFile(ObjectFile.RESIZE);
        Scene s = null;

        try {
            s = f.load("./eas/miscellaneous/java3D/schiff.obj");
        } catch (Exception e) {
            System.out.println("File loading failed:" + e);
        }

        // Generate a transformation group for the loaded object.
View Full Code Here

    private static Shape drawOBJ (String filename, boolean colored, boolean resize) {

        int params = 0;
        if (resize) params = ObjectFile.RESIZE | Loader.LOAD_ALL;
       
        ObjectFile loader = new ObjectFile(params);
        try {
            BranchGroup bg = loader.load(filename).getSceneGroup();
            bg.setCapability(BranchGroup.ALLOW_CHILDREN_READ);
            bg.setCapability(BranchGroup.ALLOW_CHILDREN_WRITE);
            bg.setCapability(BranchGroup.ALLOW_CHILDREN_EXTEND);
            bg.setCapability(BranchGroup.ALLOW_DETACH);
View Full Code Here

    private static Shape drawOBJ (String filename, boolean colored, boolean resize) {

        int params = 0;
        if (resize) params = ObjectFile.RESIZE | Loader.LOAD_ALL;
       
        ObjectFile loader = new ObjectFile(params);
        try {
            BranchGroup bg = loader.load(filename).getSceneGroup();
            bg.setCapability(BranchGroup.ALLOW_CHILDREN_READ);
            bg.setCapability(BranchGroup.ALLOW_CHILDREN_WRITE);
            bg.setCapability(BranchGroup.ALLOW_CHILDREN_EXTEND);
            bg.setCapability(BranchGroup.ALLOW_DETACH);
View Full Code Here

  // Now load the object files
  Scene s[] = new Scene[3];
  GeometryArray g[] = new GeometryArray[3];
  Shape3D shape[] = new Shape3D[3];
  ObjectFile loader = new ObjectFile(ObjectFile.RESIZE);
  for(int i=0; i<3; i++) {
      s[i] = null;
      g[i] = null;
      shape[i] = null;
  }

  for(int i=0; i<3;i++) {
      try {
    s[i] = loader.load(objFiles[i]);
      }
      catch (FileNotFoundException e) {
        System.err.println(e);
        System.exit(1);
      }
View Full Code Here

TOP

Related Classes of com.sun.j3d.loaders.objectfile.ObjectFile

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.