# Pseudo 3d with bitmap as displacement for y-axis

**URL:** <https://forum.kirupa.com/t/pseudo-3d-with-bitmap-as-displacement-for-y-axis/241886>\
**Category:** programming\
**Created:** [October 19, 2007, 5:01am UTC](https://forum.kirupa.com/t/pseudo-3d-with-bitmap-as-displacement-for-y-axis/241886 "2007-10-19T05:01:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jerryscript](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/jerryscript/32/451_2.png) [@Jerryscript](https://forum.kirupa.com/u/Jerryscript)\
**Post date:** [October 19, 2007, 5:01am UTC](https://forum.kirupa.com/t/pseudo-3d-with-bitmap-as-displacement-for-y-axis/241886/1 "2007-10-19T05:01:38Z")

</div>

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?
