|
-
Pseudo 3d with bitmap as displacement for y-axis
I'm sure someone has already done something similar to this:
Using the basic focal length formula for simple 3d positioning of objects, I wanted a simple way to create a terrain. Creating a huge array of all the terrain points and elevations is tedious and time consuming. So, I thought, why not use a displacement map of sorts.
1-create a bitmap with a black background
2-draw an arial view of the terrain on the map, using an increase in the color value for each increase in elevation, so a mountain would be a collection of concentric circles with the color value increasing towards the peak of the mountain (topographical?)
3-when passing coordinates to the focal length formula, grab the pixel value of the bitmap at those coordinates and adjust the y value based upon the color returned, ie _y+=myBitmap.getPixel(x,z);
It seems to work great. Just wondering if anyone knows of any projects using such an idea, and if so, how does it perform under actual gaming conditions?
Last edited by JerryScript; 10-19-2007 at 12:56 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|