Skip to content

Instantly share code, notes, and snippets.

@vincentdesmares
Created May 12, 2017 01:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vincentdesmares/be419e89d89f821a092b9b538d755c81 to your computer and use it in GitHub Desktop.
Save vincentdesmares/be419e89d89f821a092b9b538d755c81 to your computer and use it in GitHub Desktop.
var numCoordinates = 3; // The numbers of coordinates per vertex. Here 3 coordinates (x,y,z).
var type = gl.FLOAT; // The size of each element is a float.
var normalize = false; //we don’t want to normalize the values here.
var stride = 3 * 4 ; // the length of the stride in bytes (the size of a float in bytes is 4).
var offset = 0; // the offset in bytes between the vertices.
gl.vertexAttribPointer(attributePositionAttribute, numCoordinates, type, normalize, stride, offset);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment