Examples of Vertex3d


Examples of edu.cmu.cs.stage3.alice.scenegraph.Vertex3d

        if (pg.getVertices()!=null) {
            Vertex3d[] verts = new Vertex3d[pg.getVertices().length];
            double height = getSceneGraphGeometry().getBoundingBox().getHeight()/(double)lineCount;
            for (int i=0; i<verts.length; i++) {
                    verts[i] = new Vertex3d((Point3d)pg.getVertices()[i].position.clone(), pg.getVertices()[i].normal, null, null, new TexCoord2f());
                    verts[i].scale(1.0/height,1.0/height,1);
            }
            ((IndexedTriangleArray)this.getSceneGraphGeometry()).setVertices(verts);
        }
    }
View Full Code Here

Examples of edu.cmu.cs.stage3.alice.scenegraph.Vertex3d

        Vector3d norm2 = new Vector3d(0,0,1);

        li = triangulator.points.listIterator();
        for (int i=0; li.hasNext(); i++) {
            Point2d curPoint = (Point2d)li.next();
            triVertices[i]=new Vertex3d(new Point3d(curPoint.x,curPoint.y,-extz/2),norm1,null,null,new TexCoord2f());
            triVertices[triangulator.points.size()+i]=new Vertex3d(new Point3d(curPoint.x,curPoint.y,extz/2),norm2,null,null,new TexCoord2f());
        }

        li = triangulator.triangles.listIterator();
        for (int i=0; li.hasNext(); i++) {
            Triangle curTri = (Triangle)li.next();
View Full Code Here

Examples of edu.cmu.cs.stage3.alice.scenegraph.Vertex3d

        java.util.ListIterator li = points.listIterator();
        for (int i=0; li.hasNext(); i++) {
            Point2d point = (Point2d)li.next();

            Point3d pos = new Point3d(point.x,point.y,-extz/2);
            sideVertices[i*2]=new Vertex3d(pos,new Vector3d((Vector3f)normals.elementAt(i*2)),null,null,new TexCoord2f());
            sideVertices[i*2+1]=new Vertex3d(pos,new Vector3d((Vector3f)normals.elementAt(i*2+1)),null,null,new TexCoord2f());
            pos = new Point3d(point.x,point.y,extz/2);
            sideVertices[points.size()*2+i*2]=new Vertex3d(pos,new Vector3d((Vector3f)normals.elementAt(i*2)),null,null,new TexCoord2f());
            sideVertices[points.size()*2+i*2+1]=new Vertex3d(pos,new Vector3d((Vector3f)normals.elementAt(i*2+1)),null,null,new TexCoord2f());
        }

        for (int i=0; i<points.size()-1; i++) {
            //if (outside) {
                indices[i*6]=2*i;
 
View Full Code Here

Examples of edu.cmu.cs.stage3.alice.scenegraph.Vertex3d

    int nVersion = dis.readInt ();
    if( nVersion==1 ) {
      int vertexCount = dis.readInt();
      Vertex3d[] vertices = new Vertex3d[vertexCount];
      for (int i=0; i<vertices.length; i++) {
        vertices[i] = new Vertex3d( Vertex3d.FORMAT_POSITION | Vertex3d.FORMAT_NORMAL | Vertex3d.FORMAT_TEXTURE_COORDINATE_0 );
        vertices[i].position.x = -dis.readFloat();
        vertices[i].position.y = dis.readFloat();
        vertices[i].position.z = dis.readFloat();
        vertices[i].normal.x = -dis.readFloat();
        vertices[i].normal.y = dis.readFloat();
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.