I want to make a program that graphs a three variable function
and renders the image.
A sample function would be something like:
z = -(x^2 + y^2)
which is an inverted parabolic surface.
How can I get started with something like this?
Printable View
I want to make a program that graphs a three variable function
and renders the image.
A sample function would be something like:
z = -(x^2 + y^2)
which is an inverted parabolic surface.
How can I get started with something like this?
How about a 3D array:
(but dynamic, naturally!)Code:Dim x(10,10,10) as double
Then loop through, calculating all the values of y for different values of x and z. Then you can move through them in an oscillating motion (not a good explanation, will try to illustrate):
And so on. By making a triangle mesh with those values, you can plot your surface.Code:| |-| |-|
| | | | |
| | | | |
| ^ | ^ |
| | | | |
| | | | |
| | | | |
|-| |-| |