# Thread: info and algorithms for 3D graphics

1. ## info and algorithms for 3D graphics

I am trying to create 3D elavation maps for Mandelbrot set and similar type
fractals. My data files are x, y arrays of elavation (z) values.

Is there any information available, describing the basic procedures used in
generating a 3D view of elevation data?

I am just looking for simple renderings, with one illumination source.

2. Originally Posted by megafiddle
Is there any information available, describing the basic procedures used in
generating a 3D view of elevation data?

3. I should have mentioned that I have been searching, and there is information for the common renderings.

But I can't find anything related to producing things like a perspective view of a relief or elevation map surface.
Everthing seems to relate to geographical maps and the commercial software used for those.

Perhaps they're known by another name.

4. Use your fractal as a heightmap. Displace the Y values on an x/z grid in local space according to the values in the heightmap. The resulting grid need not be transformed to world space since the terrain can sit with it's center at 0,0,0.

5. Originally Posted by Sipher
Actually, I did find a few more things using google. I had been using Bing exclusively to try
it out. Thanks

Originally Posted by VirtualAce
Use your fractal as a heightmap. Displace the Y values on an x/z grid in local space according to the values in the heightmap. The resulting grid need not be transformed to world space since the terrain can sit with it's center at 0,0,0.
Thanks

I've been thinking along those lines. I basically need to draw a series of x, z plots, each one
"in front of" the last, displacing it down one pixel, and possibly to the right for an angle view.

Where I started having questions was in how to deal with gaps in the height from one point
to the next. The x value steps across one pixel at a time, but the height can change by any
amount. So you get an x, z scatterplot. If I can get each new line of height values to obscure
the previous, more distant lines, that will take care of the hidden surfaces.

A line graph would fill the gaps, and since each connecting line would be one or two vertical
sections, maybe just use a vertical line for each height, with the height value at the upper
tip of the line?

I think this adds a bunch of new vertices to be shaded though, not sure. Which gets to the
2nd question, better to just shade the original vertices and take care of the hidden surfaces
there, or shade the perspective view? What is the best way to generate the perspective

Anyway that was the type of information I had been searching for. "Map height" did get me
some new information.

6. I've been thinking along those lines. I basically need to draw a series of x, z plots, each one
"in front of" the last, displacing it down one pixel, and possibly to the right for an angle view.
No you need to project the vertices into screen space from 3D space if you want to view the terrain in 3D.

7. Originally Posted by VirtualAce
No you need to project the vertices into screen space from 3D space if you want to view the terrain in 3D.
I realize that I would need to do that to produce a true 3D perspective.

My idea would produce a distorted image if applied to an existing 2D map. I would be scaling
things while generating the original map however. The more distant vertical "slices" would be
smaller in both width and height. (same number of pixels, but a scaled down image)

The only distortion would be in the height. With a perspective view of a plane tilted towards
you, you should see vertical objects leaning towards you slightly. My vertical objects would
remain vertical on the slightly tilted plane.

For low viewing angles, I think the height perspective error might be of little cosequence.
Looking around at the real world, vertical lines appear more or less vertical. This would
certainly be no good for a perspective that had to be variable.

Basically just a shear between the x, z planes.