Results 1 to 2 of 2

Thread: 3D graphics rendering

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276
    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?


  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    How about a 3D array:
    Code:
    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):
    Code:
    | |-| |-|
    | | | | |
    | | | | |
    | ^ | ^ |
    | | | | |
    | | | | |
    | | | | |
    |-| |-| |
    And so on. By making a triangle mesh with those values, you can plot your surface.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width