|
With this applet you can generate
all 6 of the Quadric Surfaces, and the cylinder,
and you can do all that in about a minute once the applet is loaded
if you're using a typical 100 M Hz machine.
|
|
Quadric Surface |
Equation |
| sphere   ( elipsoid ) | x^2 + y^2 + z^2 =   1 |
| cone | x^2 + y^2 - z^2 =   0 |
| hyperboloid of one sheet | x^2 + y^2 - z^2 =   1 |
| hyperboloid of two sheets | x^2 + y^2 - z^2 = -1 |
| paraboloid | x^2 + y^2 - z     =   0 |
| hyperboloic paraboloid | x^2 - y^2 - z     =   0 |
| cylinder | x^2 + y^2         =   1 |
|
|
|
| Java Applet:   Imaging Raytracer
|
Instructions:
- 1 ) Choose a surface:   click in the list box (top left corner).
- 2 ) Move the eye position:
  do any of the following:
- a ) click on the dial to select a view angle.
- b ) click on the scrollbar to change the view height.
- c ) click on the map while thinking of the implied globe.
- d ) click on the scrollbar, then use the arrow keys.
      eg. the 'right arrow' effects a clockwise rotation.
- 3 ) Press the "[ Redraw ]" button by clicking on it.
- 4 ) Sit back and be amazed, or maybe amused.
|
See also:   An Introduction to raytracing.
See also:   A   Visual Tour of several Java applets
Note:
|
The sphere has a radius of 5 and all the other curves are clipped
by a bounding cube with x, y, and z all bounded by (+/-) 4.
All the surfaces have horizontal stripes at integer "z" elevations.
You can have any of the surfaces sit on one of the ubiquitous checkerboard surfaces,
or not, by clicking on the in the checkboard option box.
|
I'm faking the illumination model; there are no light sources,
the brightness varies directly with the 'z' value of the intercept.
Everything that I've written works FLAWLESSLY, but it isn't done yet.
Tomorrow things will be different....
In the next few weeks I will be implementing an illumination model and will allow you to
specify more of the parameters, and coming really soon: raytracing the
planet earth , viewed from any perspective and time of day.
It takes about 10 seconds for this to run on my machine
( Windows-95 / Pentium 83 OD ).
The applet times itself, look for the "Elapsed time:" line in the text output area.
I'm generally pleased with speed of this applet given all the whinning you hear
about 'windoze' and that Java is slow because it's interpretted, has extensive
error checking, blah, blah, blah.
Now if I could produce a series of frames, and allow you to save it as a
an animated gif image... which is do-able... I think...
More Java:
    Java: An Introduction :   A visual tour of several applets.
    Java Animation :     cycling through images
    Java Drawing :         A Draw / Scribble / Paint applet   (interactive)
Return:
    Contents
    Imaging the Imagined : Raytracing tips from da Vinci and me. ( my home page )
If you want to see what it looks like on my machine click here.   ( to see a static image )
( Note:   you may have to ALT-left arrow to return )
This applet is best viewed with higher resolution screens       ( 1024 x 768 ),
although it was designed to run adequately on low res screens (   680 x 480 ).
Copyright © 1997 by Paul Flavin.   All rights reserved.