Package com.googlecode.gwtgl.wrapper

Examples of com.googlecode.gwtgl.wrapper.Buffer


  /**
   * Initializes the buffers for vertex coordinates, normals and texture
   * coordinates.
   */
  private void initBuffers() {
    buffer = new Buffer(webGLWrapper, BufferTarget.ARRAY_BUFFER,
        BufferUsage.STATIC_DRAW);
    buffer.addData(VERTICES, new FloatArray(cube.getVertices()));
    buffer.addData(TEX_COORDS, new FloatArray(cube.getTexCoords()));

    checkErrors();
View Full Code Here


    float[] vertices = new float[] { 0.0f, 1.0f, -2.0f, -1.0f, -1.0f,
        -2.0f, 1.0f, -1.0f, -2.0f };
    int[] indices = new int[] {0, 1, 2};
   
    // create the vertexBuffer
    buffer = new Buffer(webGLWrapper, BufferTarget.ARRAY_BUFFER, BufferUsage.STATIC_DRAW);
    buffer.addData(VERTICES, new FloatArray(vertices));
   
    // create the indexBuffer
    indexBuffer = new Buffer(webGLWrapper, BufferTarget.ELEMENT_ARRAY_BUFFER, BufferUsage.STREAM_DRAW);
    indexBuffer.addData(INDICES, new UnsignedByteArray(indices));

    float[] colors = new float[] { 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f,
        0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f };
    buffer.addData(COLORS, new FloatArray(colors));
View Full Code Here

  /**
   * Initializes the buffers for vertex coordinates, normals and texture
   * coordinates.
   */
  private void initBuffers() {
    buffer = new Buffer(webGLWrapper, BufferTarget.ARRAY_BUFFER, BufferUsage.STATIC_DRAW);
    buffer.addData(VERTICES, new FloatArray(sphere.getVertices()));
    buffer.addData(TEX_COORDS, new FloatArray(sphere.getTexCoords()));
    buffer.addData(NORMALS, new FloatArray(sphere.getVertexNormals()));
    indicesBuffer = new Buffer(webGLWrapper, BufferTarget.ELEMENT_ARRAY_BUFFER, BufferUsage.STREAM_DRAW);
    indicesBuffer.addData(INDICES, new UnsignedByteArray(sphere.getIndices()));

    checkErrors();
  }
View Full Code Here

  /**
   * Initializes the buffers for vertex coordinates, normals and texture
   * coordinates.
   */
  private void initBuffers() {
    buffer = new Buffer(webGLWrapper, BufferTarget.ARRAY_BUFFER,
        BufferUsage.STATIC_DRAW);
    buffer.addData(VERTICES, new FloatArray(cube.getVertices()));
    buffer.addData(TEX_COORDS, new FloatArray(cube.getTexCoords()));
    buffer.addData(NORMALS, new FloatArray(cube.getVertexNormals()));

View Full Code Here

  /**
   * Initializes the buffers for vertex coordinates, normals and texture
   * coordinates.
   */
  private void initBuffers() {
    buffer = new Buffer(webGLWrapper, BufferTarget.ARRAY_BUFFER,
        BufferUsage.STATIC_DRAW);
    buffer.addData(VERTICES, new FloatArray(cube.getVertices()));
    buffer.addData(TEX_COORDS, new FloatArray(cube.getTexCoords()));

    checkErrors();
View Full Code Here

  private void initVertexBuffer() {
    // One Triangle with 3 Points à 3 coordinates
    float[] vertices = new float[] { 0.0f, 1.0f, -2.0f, -1.0f, -1.0f,
        -2.0f, 1.0f, -1.0f, -2.0f };
    // create the vertexBuffer
    vertexBuffer = new Buffer(webGLWrapper, BufferTarget.ARRAY_BUFFER,
        BufferUsage.STATIC_DRAW);
    vertexBuffer.addData("vertices", new FloatArray(vertices));
  }
View Full Code Here

TOP

Related Classes of com.googlecode.gwtgl.wrapper.Buffer

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.