g3d Version Alpha 1.0
by Eugene Agichtein
Follow this link
to see my resume
Or my Home...
Graphs regions of form
a<=x<=b
F1(x)<=y<=F2(x)
F3(x,y)<=z<=F4(x,y)
Available Functions: (as of now):
- sin(), cos(), tan(), acos(), asin(), atan() -arguments in radians
- Hyperbolic Functions - sinc(), ctan(), actan();
- sqrt, sqr, exp, log, ln.
Operators:
Type in the functions you want to graph
Click the Plot Button
Drag the mouse in the plot area to rotate the graph.
This applet might take a minute to load, please be patient, it's worth
it.
Buttons:
Single/Double Z: Toggles between 1 and
2 surfaces to Plot
If the value is set to Double, and both z1(x,y) and z2(x,y) are defined, it calculates volume using the Rieman sum
As Meshing gets better (see "Finer Grid" button) it gets more accurate
Plot: Plots the current functions in the
text windows
Refresh - fixes colors so that the Red
component reflects elevation
Finer Grid: Remeshes the object with smaller grid
Warning: Will look much nicer, but object will take longer to rotate
Wider Grid:Remeshes object with wider grid spacing
Will look rougher, but will rotate much faster
Help gives list of available functions
as well as the "About"
The demo functions might help if you are having trouble with the syntax or something.
Note: If one of the dimensions (notably Z) is very big comparative to the
others, the object might appear as a point due to scaling and round-off error.
for now you just have to adjust the limits appropriatly.
The Source Code:
This program breaks down into 2 parts: parsing the expression and
graphing it. I only did the graphing.Function parsing was done using the
classes written by David Wanqian Liu. Check out his applet The
PRECISE Calculator
Graphing Part:
Plotter.java is the class that takes strings
representing functions,
builds the 3D grid, turns it into polygons, transforms and paints it.
g3d.java is the minimal user interface needed
to build and manipulate
objects.
help.java help screens.
And of course, the ubiqitous Matrix3D.java
used for 3D transformations,
this is a slightly modified version of the Matrix3d.java that came with the JDK