Package java.nio

Examples of java.nio.FloatBuffer.rewind()


                    }

                    final FloatBufferData textureBufferData = textureCoords.get(i);
                    final FloatBuffer textureBuffer = textureBufferData != null ? textureBufferData.getBuffer() : null;
                    if (textureBuffer != null) {
                        textureBuffer.rewind();
                        ARBBufferObject.glBufferSubDataARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, offsetBytes,
                                textureBuffer);
                        offsetBytes += textureBufferData.getBufferLimit() * 4;
                    }
                }
View Full Code Here


        DVector3C vec0 = bodymatrix[i][j].getPosition();
        float[] f0 = vec0.toFloatArray();
        pos.put(f0);
      }
    }
    pos.rewind();

    GL11.glMap2f(GL11.GL_MAP2_VERTEX_3, 0, 1, size * 3, size, 0, 1, 3,
        size, pos);
    GL11.glMapGrid2f(40, 0, 1, 40, 0, 1);
    GL11.glEvalMesh2(GL11.GL_FILL, 0, 40, 0, 40);
View Full Code Here

        DVector3C vec0 = bodymatrix[i][j].getPosition();
        float[] f0 = vec0.toFloatArray();
        pos.put(f0);
      }
    }
    pos.rewind();

    GL11.glMap2f(GL11.GL_MAP2_VERTEX_3, 0, 1, size * 3, size, 0, 1, 3,
        size, pos);
    GL11.glMapGrid2f(40, 0, 1, 40, 0, 1);
    GL11.glEvalMesh2(GL11.GL_FILL, 0, 40, 0, 40);
View Full Code Here

            assert worldNormals != null;
            localNormals.rewind();
        }
        FloatBuffer colors = triMesh.getColorBuffer();
        if (colors != null) {
            colors.rewind();
        }

        ArrayList<TexCoords> texCoords = null;
        if (printTextureCoords) {
            texCoords = triMesh.getTextureCoords();
View Full Code Here

  public Geometry getDebugMesh(){
    Mesh m = new Mesh();
    m.setMode(Mode.Triangles);
    IntBuffer ib = BufferUtils.createIntBuffer(this.mCellArray.length*3*3);
    FloatBuffer vb = BufferUtils.createFloatBuffer(this.mCellArray.length*3*3);
        vb.rewind();
        int i=0;
        for(Cell c : mCellArray){
          for(int v= 0;v<3;v++){
            vb.put(c.m_Vertex[v].x);
            vb.put(c.m_Vertex[v].y);
View Full Code Here

    for(HashSet<com.l2client.navigation.Cell>  set : allBorders){
      size += set.size();
    }
    IntBuffer ib = BufferUtils.createIntBuffer(size*3*3);
    FloatBuffer vb = BufferUtils.createFloatBuffer(size*3*3);
        vb.rewind();
        int i=0;
        for(HashSet<com.l2client.navigation.Cell>  set : allBorders){
          for(Cell c : set){
            for(int v= 0;v<3;v++){
              vb.put(c.m_Vertex[v].x);
View Full Code Here

    float ambient_lightModel[] = {0.6f, 0.6f, 0.6f, 1.0f};
    FloatBuffer lightModelBuffer = BufferUtil.newFloatBuffer(ambient_lightModel.length);
    for (float aux : ambient_lightModel) {
      lightModelBuffer.put(aux);
    }
    lightModelBuffer.rewind();
      gl.glLightModelfv(GL.GL_LIGHT_MODEL_AMBIENT, lightModelBuffer);
     
      float lightPosition[] = {0.0f, 50.0f, 0.0f, 0.0f};
    FloatBuffer lightBuffer = BufferUtil.newFloatBuffer(lightPosition.length);
    for (float point : lightPosition) {
View Full Code Here

      float lightPosition[] = {0.0f, 50.0f, 0.0f, 0.0f};
    FloatBuffer lightBuffer = BufferUtil.newFloatBuffer(lightPosition.length);
    for (float point : lightPosition) {
      lightBuffer.put(point);
    }
    lightBuffer.rewind();
    gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, lightBuffer);
   
    gl.glCullFace(GL.GL_BACK);
    gl.glPolygonMode(GL.GL_FRONT, GL.GL_FILL);
   
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

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.