Package javax.media.j3d

Examples of javax.media.j3d.Shape3D


        base.setMaterial(new Material(color, C.black, color, C.white, 64.0f));
        base.setColoringAttributes(new ColoringAttributes(color, ColoringAttributes.SHADE_FLAT));
        base.setPolygonAttributes(C.noCull);
        base.setLineAttributes(C.defLine);
       
        Shape3D arrow = new Shape3D(polygon, base);
        Shape3D outline = new Shape3D(border, base);

        anim.addChild(arrow);
        anim.addChild(outline);
        String label = null;
View Full Code Here


        lod.addSwitch(sw);
        lod.setSchedulingBounds(BoardModel.bounds);

        Appearance app = new Appearance();
        app.setColoringAttributes(new ColoringAttributes(fg, ColoringAttributes.SHADE_FLAT));
        sw.addChild(new Shape3D(geom, app));

        app = new Appearance();
        Color3f lodfg = new Color3f(fg);
        lodfg.scale(2/3f);
        lodfg.add(C.grey10);
View Full Code Here

        gi.setTextureCoordinates(0, texCoords);

        Stripifier st = new Stripifier();
        st.stripify(gi);
       
        return new Shape3D(gi.getGeometryArray(), app);
    }
View Full Code Here

        base.setMaterial(new Material(color, C.black, color, C.white, 64.0f));
        base.setColoringAttributes(new ColoringAttributes(color, ColoringAttributes.SHADE_FLAT));
        base.setPolygonAttributes(C.noCull);
        base.setLineAttributes(C.defLine);

        Shape3D arrow = new Shape3D(makeArrow(source.distance(target)), base);
        Shape3D outline = new Shape3D(makeArrowOutline(source.distance(target)), base);

        anim.addChild(arrow);
        anim.addChild(outline);

        Vector3d target0 = new Vector3d(source);
View Full Code Here

        Appearance base = new Appearance();
        base.setColoringAttributes(new ColoringAttributes(color, ColoringAttributes.SHADE_FLAT));
        base.setCapability(Appearance.ALLOW_COLORING_ATTRIBUTES_WRITE);
        base.setLineAttributes(C.defLine);
       
        Shape3D shape = new Shape3D(border, base);
        shape.setAppearance(base);
    addChild(shape);
    }   
View Full Code Here

    ng.generateNormals(gi);
    GeometryArray te = gi.getGeometryArray();

    //Generate the tetrahedron as a Shape.
    Shape3D tetrahedron = new Shape3D(te,yellowApp);

    //The transformation group of the tetrahedron.
    //The tetrahedron will be rotated a little bit.
    Transform3D tfTetrahedron = new Transform3D();
    tfTetrahedron.rotX(0.4*Math.PI);
 
View Full Code Here



    //Choose a part of the object (here: schiffrumpf).
    Hashtable namedObjects = s.getNamedObjects();
    Shape3D partOfTheObject = (Shape3D) namedObjects.get("schiffsrumpf");

    //Generate a copy of the chosen part.
    Shape3D extractedObject = (Shape3D) partOfTheObject.cloneTree();

    //Paint the part in blue.
    Appearance lightBlueApp = new Appearance();
    setToMyDefaultAppearance(lightBlueApp,new Color3f(0.0f,0.1f,0.3f));
    extractedObject.setAppearance(lightBlueApp);

    //Assign the chosen part to a transformation group.
    Transform3D tfObject = new Transform3D();
    tfObject.rotZ(0.4*Math.PI);
    Transform3D xRotation = new Transform3D();
View Full Code Here

        }

        // Assign the colour blue to the part named "flugdeck".
        Appearance lightBlueApp = new Appearance();
        setToMyDefaultAppearance(lightBlueApp, new Color3f(0.0f, 0.1f, 0.3f));
        Shape3D partOfTheObject = (Shape3D) namedObjects.get("flugdeck");
        partOfTheObject.setAppearance(lightBlueApp);

        BranchGroup theScene = new BranchGroup();

        theScene.addChild(tgObject);
View Full Code Here

    LineStripArray ligneArray = new LineStripArray(ligne.size(), LineArray.COORDINATES | LineArray.COLOR_3, stripVertexCounts);
    for (int i=0; i<ligne.size(); i++){
      ligneArray.setCoordinate(i, new Point3d(ligne.get(i).y, ligne.get(i).z + 0.2, ligne.get(i).x));
      ligneArray.setColor(i, new Color3f(Color.blue));
    }
    bg.addChild(new Shape3D(ligneArray));
    simpleU.addBranchGraph(bg);
  }
View Full Code Here

    simpleU.addBranchGraph(bg);
  }
 
  public void dessinerSurface(List<Point> frontiere){
    BranchGroup bg = new BranchGroup();
    Shape3D surface = new Shape3D();
   
    float[] coords = new float[(frontiere.size()+1)*3];
        int i = 0;
        for (Point p : frontiere){
          coords[i++]= (float)p.y;
          coords[i++]= (float)p.z;
          coords[i++]= (float)p.x;
        }
        Point p = frontiere.get(0);
        coords[i++]= (float)p.y;
      coords[i++]= (float)p.z;
      coords[i++]= (float)p.x;
   
        int[] stripCount = {frontiere.size()+1}// ******
       
        GeometryInfo gi = new GeometryInfo(GeometryInfo.POLYGON_ARRAY);
        gi.setCoordinates(coords);
        gi.setStripCounts(stripCount);
        gi.recomputeIndices();
       

        NormalGenerator ng = new NormalGenerator();
        ng.generateNormals(gi);
        gi.recomputeIndices();

        Stripifier st = new Stripifier();
        st.stripify(gi);
        gi.recomputeIndices();

        surface.setAppearance(CreateurVoiture.createMaterialAppearance());
        surface.setGeometry(gi.getGeometryArray());
   
    bg.addChild(surface);
    simpleU.addBranchGraph(bg);
    //System.out.println(frontiere.size() +" pts traces");
  }
View Full Code Here

TOP

Related Classes of javax.media.j3d.Shape3D

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.