PDA

Click to See Complete Forum and Search --> : 3D graphics rendering


wey97
Nov 20th, 2000, 12:27 AM
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?

parksie
Nov 20th, 2000, 04:00 PM
How about a 3D array:

Dim x(10,10,10) as double

(but dynamic, naturally!)

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.