Package java.nio

Examples of java.nio.FloatBuffer.rewind()


        }
      }
      // norm
      bu = mesh.getFloatBuffer(Type.Normal);
      if(bu != null) {
        bu.rewind();
        for(int i=0; i<bu.capacity(); i+=3) {
          p.printf(Locale.ENGLISH,"vn %.4f %.4f %.4f\n", bu.get(), bu.get(), bu.get());
        }
      }
      //indices
View Full Code Here


    try {
      PrintWriter p = new PrintWriter(file);
      p.printf(Locale.ENGLISH,"#verts\n");
      //verts
      FloatBuffer bu = mesh.getFloatBuffer(Type.Position);
      bu.rewind();
      for(int i=0; i<bu.capacity(); i+=3) {
        p.printf(Locale.ENGLISH,"v %.4f %.4f %.4f\n", bu.get(), bu.get(), bu.get());
      }
      // tex
      bu = mesh.getFloatBuffer(Type.TexCoord);
View Full Code Here

        p.printf(Locale.ENGLISH,"v %.4f %.4f %.4f\n", bu.get(), bu.get(), bu.get());
      }
      // tex
      bu = mesh.getFloatBuffer(Type.TexCoord);
      if(bu != null) {
        bu.rewind();
        for(int i=0; i<bu.capacity(); i+=3) {
          p.printf(Locale.ENGLISH,"vt %.4f %.4f %.4f\n", bu.get(), bu.get(), bu.get());
        }
      }
      // norm
View Full Code Here

        }
      }
      // norm
      bu = mesh.getFloatBuffer(Type.Normal);
      if(bu != null) {
        bu.rewind();
        for(int i=0; i<bu.capacity(); i+=3) {
          p.printf(Locale.ENGLISH,"vn %.4f %.4f %.4f\n", bu.get(), bu.get(), bu.get());
        }
      }
      //indices
View Full Code Here

    try {
      PrintWriter p = new PrintWriter(file);
      p.printf(Locale.ENGLISH,"#verts\n");
      //verts
      FloatBuffer bu = mesh.getFloatBuffer(Type.Position);
      bu.rewind();
      for(int i=0; i<bu.capacity(); i+=3) {
        p.printf(Locale.ENGLISH,"v %.4f %.4f %.4f\n", bu.get(), bu.get(), bu.get());
      }
      // tex
      bu = mesh.getFloatBuffer(Type.TexCoord);
View Full Code Here

        p.printf(Locale.ENGLISH,"v %.4f %.4f %.4f\n", bu.get(), bu.get(), bu.get());
      }
      // tex
      bu = mesh.getFloatBuffer(Type.TexCoord);
      if(bu != null) {
        bu.rewind();
        for(int i=0; i<bu.capacity(); i+=3) {
          p.printf(Locale.ENGLISH,"vt %.4f %.4f %.4f\n", bu.get(), bu.get(), bu.get());
        }
      }
      // norm
View Full Code Here

        }
      }
      // norm
      bu = mesh.getFloatBuffer(Type.Normal);
      if(bu != null) {
        bu.rewind();
        for(int i=0; i<bu.capacity(); i+=3) {
          p.printf(Locale.ENGLISH,"vn %.4f %.4f %.4f\n", bu.get(), bu.get(), bu.get());
        }
      }
      //indices
View Full Code Here

          offsets[0] = 0// always only the first keyframe
          offsets[1] = 3*indices*keyframes;
          offsets[2] = 2*indices+offsets[1];
          offsets[3] = 3*indices*keyframes+offsets[2];
         
          data.rewind();

          for(int n=0;n<indices;n++){
            data.position(offsets[0]);
            data.get(temp, 0, 3);
            data.position(offsets[1]);
View Full Code Here

        if (GLGeom._shapes.containsKey(hashCode())) {
            p = (Polygon) GLGeom._shapes.get(hashCode());
        } else {
            p = new Polygon();
            FloatBuffer b = VBOMapArray(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, 0);
            b.rewind();
            while (b.hasRemaining()) {
                p.addPoint(Math.round(b.get()), Math.round(b.get()));
            }
            VBOUnmapArray(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, 0);
            if (keepBinding) {
View Full Code Here

        if (GLGeom._shapes.containsKey(hashCode())) {
            p = (Polygon) GLGeom._shapes.get(hashCode());
        } else {
            p = new Polygon();
            FloatBuffer vertices = VBOMapArray(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, 0);
            vertices.rewind();
            while (vertices.hasRemaining()) {
                p.addPoint(Math.round(vertices.get()), Math.round(vertices.get()));
            }
            VBOUnmapArray(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, 0);
            if (keepBinding) {
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.