Package com.eteks.sweethome3d.j3d

Examples of com.eteks.sweethome3d.j3d.OBJWriter.writeNode()


    // 1. Open the OBJ file "Test.obj"
    OBJWriter writer = new OBJWriter("Test@#.obj", "Test", 3);
    assertTrue("Test@#.obj not created", new File("Test@#.obj").exists());
   
    // 2. Write a box at center
    writer.writeNode(new Box());
   
    // Write a sphere centered at (2, 0, 2)
    Transform3D translation = new Transform3D();
    translation.setTranslation(new Vector3f(2f, 0, 2f));
    TransformGroup translationGroup = new TransformGroup(translation);
View Full Code Here


    Transform3D translation = new Transform3D();
    translation.setTranslation(new Vector3f(2f, 0, 2f));
    TransformGroup translationGroup = new TransformGroup(translation);
   
    translationGroup.addChild(new Sphere());
    writer.writeNode(translationGroup);
   
    // 3. Close file
    writer.close();
    assertTrue("Test@#.mtl not created", new File("Test@#.mtl").exists());
   
View Full Code Here

          // Create a not alive new ground to be able to explore its coordinates without setting capabilities
          Rectangle2D homeBounds = getExportedHomeBounds(home);
          Ground3D groundNode = new Ground3D(home,
              (float)homeBounds.getX(), (float)homeBounds.getY(),
              (float)homeBounds.getWidth(), (float)homeBounds.getHeight(), true);
          writer.writeNode(groundNode, "ground");
        }
       
        // Write 3D walls
        int i = 0;
        for (Wall wall : home.getWalls()) {
View Full Code Here

        // Write 3D walls
        int i = 0;
        for (Wall wall : home.getWalls()) {
          // Create a not alive new wall to be able to explore its coordinates without setting capabilities
          Wall3D wallNode = new Wall3D(wall, home, true, true);
          writer.writeNode(wallNode, "wall_" + ++i);
        }
        // Write 3D furniture
        i = 0;
        for (HomePieceOfFurniture piece : home.getFurniture()) {
          if (piece.isVisible()) {
View Full Code Here

        i = 0;
        for (HomePieceOfFurniture piece : home.getFurniture()) {
          if (piece.isVisible()) {
            // Create a not alive new piece to be able to explore its coordinates without setting capabilities
            HomePieceOfFurniture3D pieceNode = new HomePieceOfFurniture3D(piece, home, true, true);
            writer.writeNode(pieceNode);
          }
        }
        // Write 3D rooms
        i = 0;
        for (Room room : home.getRooms()) {
View Full Code Here

        // Write 3D rooms
        i = 0;
        for (Room room : home.getRooms()) {
          // Create a not alive new room to be able to explore its coordinates without setting capabilities
          Room3D roomNode = new Room3D(room, home, false, true, true);
          writer.writeNode(roomNode, "room_" + ++i);
        }
      } catch (InterruptedIOException ex) {
        exportInterrupted = true;
        throw new InterruptedRecorderException("Export to " + objFile + " interrupted");
      } catch (IOException ex) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.