gfxfundamentals / webgl2-fundamentals

WebGL 2 lessons starting from the basics
https://webgl2fundamentals.org
BSD 3-Clause "New" or "Revised" License
1.72k stars 216 forks source link

For Position Explain #176

Open AlexTerry1024 opened 2 years ago

AlexTerry1024 commented 2 years ago

Hello, How are you?

createBufferAndSetupAttribute(positionLoc, [ -1, -1, 1, -1, -1, 1, -1, 1, 1, -1, 1, 1, ]);

For those position, I hope you explain the position usage.

Thank you.

Mookiepiece commented 1 year ago

@AlexTerry1024

Please review the first lesson: https://webgl2fundamentals.org/webgl/lessons/webgl-fundamentals.html

// three 2d points var positions = [ 0, 0, 0, 0.5, 0.7, 0, ];

So the positions you given will draw two triangles, they fill the entire canvas.