Package com.sun.j3d.utils.geometry

Examples of com.sun.j3d.utils.geometry.Stripifier


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

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

        Shape3D shape3D = new Shape3D();
        shape3D.setAppearance(createMaterialAppearance(color));
        shape3D.setGeometry(gi.getGeometryArray());
View Full Code Here


        int sc[]=new int [1];
        sc[0]=values.length/3;
        gi.setStripCounts(sc);
        NormalGenerator ng = new NormalGenerator();
        ng.generateNormals(gi);
        Stripifier st = new Stripifier();
        st.stripify(gi);
        GeometryArray result = gi.getGeometryArray();
        return result;
    }
View Full Code Here

        gi.setContourCounts(new int[] { 1 });

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

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

        gi.setStripCounts(new int[] { border.length/3 });

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

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

        gi.setTextureCoordinates(0, tcoords);
       
        NormalGenerator ng = new NormalGenerator();
        ng.generateNormals(gi);

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

        return gi.getGeometryArray();
    }
View Full Code Here

        gi.setCoordinates(arrowVertices);
        gi.setStripCounts(arrowStrips);
        gi.setContourCounts(contours);
        gi.setNormals(normals);

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

        gi.setCoordinates(vertices);
        gi.setStripCounts(arrowStrips);
        gi.setContourCounts(contours);
        gi.setNormals(normals);

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

        gi.setNormals(normals);

        gi.setTextureCoordinateParams(1, 2);
        gi.setTextureCoordinates(0, texCoords);

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

        gi.setTextureCoordinates(0, texcoords);

        NormalGenerator ng = new NormalGenerator();
        ng.generateNormals(gi);
       
        Stripifier st = new Stripifier();
        st.stripify(gi);

        geom[0] = gi.getGeometryArray();
       
        // top
        int[] strips = new int[scounts.size()];
        for (int i = 0; i < strips.length; i++) {
            strips[i] = scounts.elementAt(i).intValue();
        }
        count = new int[ccnt];
        vertices = new double[total*3];
        texcoords = new float[total*2];
        float[] normals = new float[total*3];
        voff = 0;
        toff = 0;
        int noff = 0;
        for (int i = 0; i < ccnt; i++) {
            Vector<int[]> contour = contours.elementAt(i);
            count[i] = contour.size();
            // reverse path to get front and back face right
            for (int j = count[i]-1; j >= 0; j--) {
                int[] v = contour.elementAt(j);
                vertices[voff++] = v[0]/vw-vo;
                vertices[voff++] = -v[1]/vh+vo;
                vertices[voff++] = 0.5;
                normals[noff++] = 0.0f;
                normals[noff++] = 0.0f;
                normals[noff++] = 1.0f;
                texcoords[toff++] = v[0]/tw;
                texcoords[toff++] = 1.0f-v[1]/th;
            }
        }

        gi = new GeometryInfo(GeometryInfo.POLYGON_ARRAY);

        gi.setCoordinates(vertices);
        gi.setNormals(normals);
        gi.setContourCounts(strips);
        gi.setStripCounts(count);
        gi.setTextureCoordinateParams(1, 2);
        gi.setTextureCoordinates(0, texcoords);

        st.stripify(gi);

        geom[1] = gi.getIndexedGeometryArray(false);

        voff = toff = noff = 0;
        // bottom
        for (int i = 0; i < ccnt; i++) {
            Vector<int[]> contour = contours.elementAt(i);
            count[i] = contour.size();
            // don't reverse path to get front and back face right
            for (int j = 0; j < count[i]; j++) {
                int[] v = contour.elementAt(j);
                vertices[voff++] = v[0]/vw-vo;
                vertices[voff++] = -v[1]/vh+vo;
                vertices[voff++] = -0.5;
                normals[noff++] = 0.0f;
                normals[noff++] = 0.0f;
                normals[noff++] = -1.0f;
                texcoords[toff++] = v[0]/tw;
                texcoords[toff++] = 1.0f-v[1]/th;
            }
        }

        gi = new GeometryInfo(GeometryInfo.POLYGON_ARRAY);

        gi.setCoordinates(vertices);
        gi.setNormals(normals);
        gi.setContourCounts(strips);
        gi.setStripCounts(count);
        gi.setTextureCoordinateParams(1, 2);
        gi.setTextureCoordinates(0, texcoords);

        st.stripify(gi);

        geom[2] = gi.getIndexedGeometryArray(false);
       
        return geom;
    }
View Full Code Here

        gi.setNormals(normals);

        gi.setTextureCoordinateParams(1, 2);
        gi.setTextureCoordinates(0, texCoords);
       
        Stripifier st = new Stripifier();
        st.stripify(gi);
       
        return gi.getGeometryArray();
    }
View Full Code Here

TOP

Related Classes of com.sun.j3d.utils.geometry.Stripifier

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.