Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
mizok committed Sep 18, 2022
1 parent 69532e5 commit 6ec22a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/examples/dream/ts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,13 @@ const init = () => {
const positionAttribLocation = gl.getAttribLocation(program, 'a_position');
const colorAttribLocation = gl.getAttribLocation(program, 'a_color');


gl.clearColor(1, 1, 1, 1);
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);

gl.useProgram(program);

const nodeGroup = [];
for (let i = 0; i < 30; i++) {
nodeGroup[i] = [Math.random(), Math.random()]
}


const draw = (bufferArr: number[]) => {
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(bufferArr), gl.STATIC_DRAW);
Expand Down Expand Up @@ -140,6 +138,7 @@ const init = () => {
const coordinates = [];
const { points, group } = defaultGroup.length > 0 ? genDelaunayPointsData(defaultGroup) : genDelaunayPointsData();
const triangles = points.triangles;
console.log(triangles, group);
for (let i = 0; i < triangles.length; i += 3) {
coordinates.push([
[group[triangles[i]][0], group[triangles[i]][1]],
Expand Down
1 change: 1 addition & 0 deletions src/examples/dream/ts/shaders/vertex.vert
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

attribute vec2 a_position;
attribute vec3 a_color ;

varying vec3 fragColor;

void main(void) {
Expand Down

0 comments on commit 6ec22a8

Please sign in to comment.