Question: Modify the code to add the ability to change the color of the triangle to red, green, blue, and black in the drop down menu.
Modify the code to add the ability to change the color of the triangle to red, green, blue, and black in the drop down menu.
---html---
#version 300 es
in vec4 aPosition;
uniform float uTheta;
void
main()
{
float s = sin(uTheta);
float c = cos(uTheta);
gl_Position.x = -s*aPosition.y + c*aPosition.x;
gl_Position.y = s*aPosition.x + c*aPosition.y;
gl_Position.z = 0.0;
gl_Position.w = 1.0;
}
#version 300 es
precision mediump float;
out vec4 fColor;
void
main()
{
fColor = vec4( 1.0, 0.0, 0.0, 1.0 );
}
speed 0%
min="0" max="100" step="10" value="50" />
100%
Oops ... your browser doesn't support the HTML5 canvas element
