Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function genData(count) {
- count = count|0;
- var verts = new Float32Array(count * 8);
- var mark_idx = new Float32Array(count * 4);
- var indices = new Uint32Array(count * 6);
- for (var i = 0; i < count; i++) {
- var vOff = i * 8;
- verts[vOff + 0] = -1.0;
- verts[vOff + 1] = -1.0;
- verts[vOff + 2] = 1.0;
- verts[vOff + 3] = -1.0;
- verts[vOff + 4] = 1.0;
- verts[vOff + 5] = 1.0;
- verts[vOff + 6] = -1.0;
- verts[vOff + 7] = 1.0;
- var iOff = i * 4;
- for (var b = 0; b < 4; b++) {
- mark_idx[iOff + b] = i;
- }
- var ixOff = i * 6;
- indices[ixOff + 0] = iOff + 0;
- indices[ixOff + 1] = iOff + 1;
- indices[ixOff + 2] = iOff + 2;
- indices[ixOff + 3] = iOff + 0;
- indices[ixOff + 4] = iOff + 2;
- indices[ixOff + 5] = iOff + 3;
- }
- return {verts: verts, mark_idx: mark_idx, indices: indices};
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement