Complete the assignment
This commit is contained in:
parent
a360ca4816
commit
f6d9bbadb9
@ -6,7 +6,7 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body onload="main()">
|
<body onload="main()">
|
||||||
<canvas id="webgl" width="400" height="400">
|
<canvas id="webgl" width="600" height="400">
|
||||||
Please use a browser that supports "canvas"
|
Please use a browser that supports "canvas"
|
||||||
</canvas>
|
</canvas>
|
||||||
|
|
@ -7,14 +7,14 @@ const vertex_shader = `
|
|||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
gl_Position = a_Position;
|
gl_Position = a_Position;
|
||||||
gl_PointSize = 10.0;
|
gl_PointSize = 25.0;
|
||||||
} `;
|
} `;
|
||||||
|
|
||||||
|
|
||||||
const fragment_shader = `
|
const fragment_shader = `
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
|
gl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);
|
||||||
} `;
|
} `;
|
||||||
|
|
||||||
function main()
|
function main()
|
||||||
@ -50,7 +50,7 @@ function main()
|
|||||||
canvas.onmousedown = function(ev){ click(ev, gl, canvas, a_Position); };
|
canvas.onmousedown = function(ev){ click(ev, gl, canvas, a_Position); };
|
||||||
|
|
||||||
// Specify the color for clearing <canvas>
|
// Specify the color for clearing <canvas>
|
||||||
gl.clearColor(0.0, 1.0, 0.0, 1.0);
|
gl.clearColor(0.3, 0.3, 0.3, 1.0);
|
||||||
|
|
||||||
// Clear <canvas>
|
// Clear <canvas>
|
||||||
gl.clear(gl.COLOR_BUFFER_BIT);
|
gl.clear(gl.COLOR_BUFFER_BIT);
|
Loading…
Reference in New Issue
Block a user