Skip to content

Commit e763b58

Browse files
committed
tutorial 04
1 parent 070fd03 commit e763b58

File tree

3 files changed

+411
-10
lines changed

3 files changed

+411
-10
lines changed

t02-adicionando-cores/index.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,12 @@
167167

168168
triangleVertexColorBuffer = gl.createBuffer();
169169
gl.bindBuffer(gl.ARRAY_BUFFER, triangleVertexColorBuffer);
170-
var colors = [
170+
var cores = [
171171
1.0, 0.0, 0.0, 1.0,
172172
0.0, 1.0, 0.0, 1.0,
173173
0.0, 0.0, 1.0, 1.0,
174174
];
175-
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(colors), gl.STATIC_DRAW);
175+
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(cores), gl.STATIC_DRAW);
176176
triangleVertexColorBuffer.itemSize = 4;
177177
triangleVertexColorBuffer.numItems = 3;
178178

@@ -190,12 +190,12 @@
190190

191191
squareVertexColorBuffer = gl.createBuffer();
192192
gl.bindBuffer(gl.ARRAY_BUFFER, squareVertexColorBuffer);
193-
colors = [];
193+
cores = [];
194194
for(var i =0; i < 4; i++)
195195
{
196-
colors = colors.concat([0.5, 0.5, 1.0, 1.0]);
196+
cores = cores.concat([0.5, 0.5, 1.0, 1.0]);
197197
}
198-
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(colors), gl.STATIC_DRAW);
198+
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(cores), gl.STATIC_DRAW);
199199
squareVertexColorBuffer.itemSize = 4;
200200
squareVertexColorBuffer.numItems = 4;
201201
}

t03-movimentando-formas/index.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,12 @@
181181

182182
triangleVertexColorBuffer = gl.createBuffer();
183183
gl.bindBuffer(gl.ARRAY_BUFFER, triangleVertexColorBuffer);
184-
var colors = [
184+
var cores = [
185185
1.0, 0.0, 0.0, 1.0,
186186
0.0, 1.0, 0.0, 1.0,
187187
0.0, 0.0, 1.0, 1.0,
188188
];
189-
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(colors), gl.STATIC_DRAW);
189+
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(cores), gl.STATIC_DRAW);
190190
triangleVertexColorBuffer.itemSize = 4;
191191
triangleVertexColorBuffer.numItems = 3;
192192

@@ -204,12 +204,12 @@
204204

205205
squareVertexColorBuffer = gl.createBuffer();
206206
gl.bindBuffer(gl.ARRAY_BUFFER, squareVertexColorBuffer);
207-
colors = [];
207+
cores = [];
208208
for(var i =0; i < 4; i++)
209209
{
210-
colors = colors.concat([0.5, 0.5, 1.0, 1.0]);
210+
cores = cores.concat([0.5, 0.5, 1.0, 1.0]);
211211
}
212-
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(colors), gl.STATIC_DRAW);
212+
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(cores), gl.STATIC_DRAW);
213213
squareVertexColorBuffer.itemSize = 4;
214214
squareVertexColorBuffer.numItems = 4;
215215
}

0 commit comments

Comments
 (0)