Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Modify the code to add the options of changing the color of the rotating triangle. ----HTML------ !DOCTYPE html> Rotating Square #version 300 es in vec4
Modify the code to add the options of changing the color of the rotating triangle.
----HTML------
!DOCTYPE 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