Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- attribute vec4 position;
- uniform mat4 supermatrix;
- void main()
- {
- // the value at supermatrix[3][3] is a float that is incremented by .01 every draw call
- float Q = sin(supermatrix[3][3]);
- /*
- I want to scale the vertices of a rectangle that occupies the
- top right quadrant of the screen ((0,0) -> (1,1)) vertically
- by whatever the value of Q is, so I multiply the vertices by
- a scaling matrix which should scale the vertices' y values by Q.
- As rendering progresses, the the vertices should be scaled
- by -1x to 1x in a sinusoidal shape.
- But it doesn't. As soon as Q is negative, the rectangle no longer renders.
- */
- gl_Position = position*mat4(vec4(1.0,0.0,0.0,0.0),
- vec4(0.0, Q ,0.0,0.0),
- vec4(0.0,0.0, Q ,0.0),
- vec4(0.0,0.0,0.0,1.0));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement