Package javax.media.j3d

Examples of javax.media.j3d.Shape3D


     */
    protected void addTo(Group bg, Iterator shapeIterator) {

        while (shapeIterator.hasNext()) {
            try {
                Shape3D shape = (Shape3D) shapeIterator.next();
                if (shape != null) {
                    bg.addChild(shape);
                }
            } catch (ClassCastException cce) {
                continue;
View Full Code Here


        appear.setTexture(texture);

        appear.setTransparencyAttributes(new TransparencyAttributes(TransparencyAttributes.FASTEST, 0.1f));

        Shape3D planeObj = new Shape3D(plane, appear);
        addChild(planeObj);

    }
View Full Code Here

                // else
                //              pointer += 2;
            }
        }

        Shape3D shape = new Shape3D(gridStrip);

        Appearance appear = new Appearance();
        PolygonAttributes polyAttrib = new PolygonAttributes();
        if (polyline) {
            polyAttrib.setPolygonMode(PolygonAttributes.POLYGON_LINE);
        }
        polyAttrib.setCullFace(PolygonAttributes.CULL_NONE);

        appear.setPolygonAttributes(polyAttrib);

        shape.setAppearance(appear);

        HashSet set = new HashSet();
        set.add(shape);

        return set.iterator();
View Full Code Here

        double pntx = 0;
        double pnty = 0;
        double pntz = baselineHeight;

        HashSet set = new HashSet();
        Shape3D shape3D = null;

        Debug.message("3detail",
                "OMGraphicUtil.createShape3D(): figuring out coordinates");

        // Creating the data[]
View Full Code Here

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

        Shape3D shape3D = new Shape3D();
        shape3D.setAppearance(createMaterialAppearance(color));
        shape3D.setGeometry(gi.getGeometryArray());

        return shape3D;
    }
View Full Code Here

                | LineArray.COLOR_4, new int[] { numPoints });

        la.setCoordinates(0, data);
        Color4b[] colors = createColorArray(numPoints, color);
        la.setColors(0, colors);
        return new Shape3D(la);
    }
View Full Code Here

        Appearance a = new Appearance();
    a.setPolygonAttributes(new PolygonAttributes(PolygonAttributes.POLYGON_LINE, PolygonAttributes.CULL_NONE, 0));
    ColoringAttributes ca = new ColoringAttributes();
    ca.setColor(0.0f,0.0f,1.0f);
    a.setColoringAttributes(ca);
    Shape3D saxis = new Shape3D(la, a);
    axisGroup.addChild(saxis);
       
        // Y axis in green
        axis = AxisMaker.makeAxis(1);
        la = new LineArray(axis.length/3, LineArray.COORDINATES);
        la.setCoordinates(0,axis);
        a = new Appearance();
    a.setPolygonAttributes(new PolygonAttributes(PolygonAttributes.POLYGON_LINE, PolygonAttributes.CULL_NONE, 0));
    ca = new ColoringAttributes();
    ca.setColor(0.0f,1.0f,0.0f);
    a.setColoringAttributes(ca);
    saxis = new Shape3D(la, a);
    axisGroup.addChild(saxis);
       
        // Z axis in purple
        axis = AxisMaker.makeAxis(2);
        la = new LineArray(axis.length/3, LineArray.COORDINATES);
        la.setCoordinates(0,axis);
        a = new Appearance();
    a.setPolygonAttributes(new PolygonAttributes(PolygonAttributes.POLYGON_LINE, PolygonAttributes.CULL_NONE, 0));
    ca = new ColoringAttributes();
    ca.setColor(1.0f,0.0f,1.0f);
    a.setColoringAttributes(ca);
    saxis = new Shape3D(la, a);
    axisGroup.addChild(saxis);
       
    mainSwitch = new Switch(Switch.CHILD_MASK);
   
    mainSwitch.addChild(branchgroup);
View Full Code Here

        Appearance a = new Appearance();
    a.setPolygonAttributes(new PolygonAttributes(PolygonAttributes.POLYGON_LINE, PolygonAttributes.CULL_NONE, 0));
    ColoringAttributes ca = new ColoringAttributes();
    ca.setColor(1.0f,1.0f,0.0f);
    a.setColoringAttributes(ca);
    lightVector = new Shape3D(la, a);
        rootGroup.addChild(lightVector);
        attach();
    }
View Full Code Here

        Appearance a = new Appearance();
    a.setPolygonAttributes(new PolygonAttributes(PolygonAttributes.POLYGON_LINE, PolygonAttributes.CULL_NONE, 0));
    ColoringAttributes ca = new ColoringAttributes();
    ca.setColor(0.0f,0.0f,1.0f);
    a.setColoringAttributes(ca);
    Shape3D saxis = new Shape3D(la, a);
    axisGroup.addChild(saxis);
       
        // Y axis in green
        axis = AxisMaker.makeAxis(1);
        la = new LineArray(axis.length/3, LineArray.COORDINATES);
        la.setCoordinates(0,axis);
        a = new Appearance();
    a.setPolygonAttributes(new PolygonAttributes(PolygonAttributes.POLYGON_LINE, PolygonAttributes.CULL_NONE, 0));
    ca = new ColoringAttributes();
    ca.setColor(0.0f,1.0f,0.0f);
    a.setColoringAttributes(ca);
    saxis = new Shape3D(la, a);
    axisGroup.addChild(saxis);
       
        // Z axis in purple
        axis = AxisMaker.makeAxis(2);
        la = new LineArray(axis.length/3, LineArray.COORDINATES);
        la.setCoordinates(0,axis);
        a = new Appearance();
    a.setPolygonAttributes(new PolygonAttributes(PolygonAttributes.POLYGON_LINE, PolygonAttributes.CULL_NONE, 0));
    ca = new ColoringAttributes();
    ca.setColor(1.0f,0.0f,1.0f);
    a.setColoringAttributes(ca);
    saxis = new Shape3D(la, a);
    axisGroup.addChild(saxis);
       
    mainSwitch = new Switch(Switch.CHILD_MASK);
   
    mainSwitch.addChild(branchgroup);
View Full Code Here

      iqa.setCoordinateIndices(0,index);
      iqa.setNormalIndices(0,index);
     
        anonymousNodeNumber++;
        name = NodeResourcesManager.getNodeName("Cube") + ((anonymousNodeNumber == 1) ? "" : String.valueOf(anonymousNodeNumber));
        return new Shape3D(iqa);
    }
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.