This code will be the starting place for project one. This code is similar to what a group of students from the fall 1998 Visualization class turned in for the second project. Before we trash this code, we note that there are several problems with it. 1. What is is with the reserving space JLabel? (see Heavy vs Lightweight widgets). 2. Why do the graphs disappear when you look from below? 3. Why the ugly lights? 4. Why the funky 2^n item menu? Our goal for project 1 is to view triple integral regions in 3 space of the form (call it A) {(x,y,z): a <= x <= b && f(x) <= y <= g(x) && F(x, y) <= z <= G(x, y)} Step 1. Get a collection of points which describe the region. For example given m, n one can form a mesh for the top and bottom like for i = 0 to m do for j = 0 to n do [x(i), y(i,j), z(i, j)] is a point on the mesh. For equally space points the bottom mesh would be. (A good starting point) x(i) = a + i*(b-a)/m. y(i,j) = f(x(i)) + j*(g(x(i))-f(x(i))/n. z(i,j) = F(x(i),y(i,j)) We create the region with the top mesh, the bottom mesh and connect the edges to fill in the sides. (Sometimes equally space points are not the best for visualizing functions due to something called aliasing. But usually this is not a problem for triple integral regions. For any given a, b, f(x), g(x), F(x,y), G(x,y) the region we have called A may not be well defined. For example, if b < a the region is empty. Or what if f(x) and g(x) cross in the region? Our program should throw an IllFormRegionException with a message of what is going on. In any case we need some test data. Here are some sample regions. The maple files region{0,1,2,3},{mws,txt} show "pictures" of these regions like we want for our project: 0: { (x,y,z): -1 <= x,y,z <= 1} 1: { (x,y,z): x^2+y^2 <= 1, -sqrt(1-x^2-y^2) <= z <= (sin(x*Pi)+1)/2 } 2: { (x,y,z): 0 <= x <= 1, sqrt(x) <= y <= 1, 0 <= z <= 1 - y } 3: { (x,y,z): x^2+y^2 <= 1, x^2+z^2 <= 1 } Step 2. The current green package has a number of modes to help one visualize the region. We would like to keep these working. Step 3. Something that you do not notice about green (because the functions are chosen carefully) is that it can only handle functions that are small (say in the cube of side two centered at the origin.) We need a way to handle "bigger and smaller objects". Another limitation of green is there is no text in the 3D window. We such be able to at least at "X", "Y" and "Z" to axes. Step 4. The user interface leaves a lot to be desired, we should give ourselves time to improve it. For example, the "flashing" makes the code look "unfinished". We could put the Canvas3D in its own window which should fix the flashing. The current menu's in green are nothing to write home about. The function menu should be checkbox's and the mode menu should be radiobutton's. (Of course both of these could disappear in the new code.) And why aren't the functions named ( "sin(x)+sin(y)" instead of Fun1)? [This could require another method to Function3F, namely "public String name();".] We should be able to turn off the axes. This could on for ever, but need to stop somewhere. I would like to put on item on the wish list. Wouldn't it be nice to be able to input the functions at run time?