This page was last updated: January 3, 2025
| Parameter | What It Does | Does it have to be varied? |
|---|---|---|
| uSc | s center of the ML | Yes |
| uTc | t center of the ML | Yes |
| uRad | Radius of the ML | Yes |
| uMag | Magnification Factor | Yes |
| uWhirl | Whirl coefficient | Yes |
| uMosaic | Mosaic'ing coefficient | Yes |
##OpenGL GLIB Ortho -5. 5. -5. 5. LookAt 0 0 2 0 0 0 0 1 0 Texture2D 5 image.bmp Vertex magnifywhirlmosaic.vert Fragment magnifywhirlmosaic.frag Program MagnifyWhirlMosaic \ uSc <0. .5 1.> \ uTc <0. .5 1.> \ uRad <0.01 ?? ??> \ uMag <.1 ?? ??> \ uWhirl <-30. 0. 30.> \ uMosaic <0.001 0.001 0.1> \ uImageUnit 5 QuadXY .1 1.
vec2 st = vST - vec2(???,???); // make (0,0) the center of the circle
if( current fragment is outside uRad )
{
vec3 rgb = texture( uImageUnit, vST ).rgb;
gl_FragColor = vec4( rgb, 1. );
}
else
{
float r = the length of st float r' = << if you want to magnify the image by uMag, you do ????? to the length of its (s,t) >>
float θ = atan( st.t, st.s ); float θ' = θ - uWhirl * r';
st = r' * vec2( cosθ',sinθ' ); // now in the range -1. to +1. st += ?;
// which block of pixels will this pixel be in? int numins = ??? // same as with the ellipses except use uMosaic instead of uAd and uBd int numint = ??? float sc = ??? // center of the block float tc = ??? // for this entire block of pixels, we are only going to sample the texture at its center (sc,tc): st.s = sc; st.t = tc;
vec3 rgb = texture( uImageUnit, st ).rgb; gl_FragColor = vec4( rgb, 1. ); }
Use Canvas to turn in your:
| Original | Magnify | Whirl | Mosaic |
| Feature | Points |
|---|---|
| Something different happens inside the circle | 20 |
| The circle can be resized and moved | 20 |
| Magnification works | 20 |
| Whirling works | 20 |
| Mosaic'ing works | 20 |
| Potential Total | 100 |