Graphics Reference
In-Depth Information
Figure 16.28. Morphing between a dino and a sphere. From left to right, uBlend is 0.0, 0.5, and 1.0.
vColor = aColor;
gl_Position = uModelViewProjectionMatrix *
mix( aVertex, vertex0, uBlend );
}
In a very similar way, you can also morph between a general object and a
sphere, as shown in Figure 16.28. All you need to do is leave out the part about
clamping to the fixed sides.
Algorithmic Art
Algorithmic art is a field in which interesting images are generated through
the use of computer algorithms. An introduction to the concept may be found
at [1]. The field is very broad, and many aspects of it are perfect for implement-
ing with shaders, especially those that create images based on the positions of
pixels on the screen. We have already seen how Mandelbrot and Julia sets are
generated in this way.
Connett Circles
One particular (and very simple) example of an algorithm that generates what
are called Connet Circles is the Circle 2 algorithm [15], discovered by J. E.
Connet. In this algorithm, each fragment's x - and y -coordinates are examined
to see what circle radius they lie on. That radius is squared and cast to an inte-
ger. If that integer is odd, the fragment is discarded. If it is even, then a color is
assigned to it and it is ploted in that color.
Search WWH ::




Custom Search