Computer Graphics - California State University Stanislaus

advertisement
Computer Graphics:
Programming, Problem Solving,
and Visual Communication
Steve Cunningham
California State University Stanislaus and Grinnell College
PowerPoint Instructor’s Resource
Nonpolygon Graphics
Techniques that lie generally
outside the OpenGL graphics
model
A Number of Techniques…
• Ray tracing
• Ray casting
• Iterated function systems
– Contraction mappings
– Generating functions
– Mandelbrot and Julia sets
Ray Casting
• Create a “virtual
screen” and
generate a ray from
the eye point through
each point on the
screen
• Compute what each
ray hits in the
screen, and color the
pixel the appropriate
color
Ray Casting (2)
• The value of ray
casting lies in being
able to compute
whatever the ray hits
• This may be a
computation of a
single hit or may
involve many things
along the ray, as in
volume rendering
Ray Tracing
• Ray tracing starts with ray casting, but
includes the possibility of generating
new rays when the original ray hits
something
– Reflection rays
– Refraction rays
– Rays to light sources
Ray Tracing (2)
• Ray tree, with
reflection R,
refraction T, and
light L rays shown
• Example ray-traced
image, from
POVRay
IFS - Contraction Mapping
• Generate a number of random points (in
either 2D or 3D space)
• Apply a recursive stochastic function
that maps the point into other points
• After a given number of steps, stop the
recursion and plot the points
Contraction Mappings (2)
• Example: Sierpinski
Gasket
• Example: fern
IFS - Generating Functions
• Blancmange function
• Dragon curve
IFS - Mandelbrot and Julia Sets
• Mandelbrot set
• Julia set
Download