This project computes a grayed intensity for each pixel color, and it turns them into 3D visualization.
This could be used to perform ground topography or any other mathematical computation, or just for fun.
The default representation is using raster point (gl_dPoint) , but it could also use line (gl_dLine) or any other 3D primitive.
To switch between point and line, you have to edit the code shown below: glPushMatrix()
glRotatef(90, 1, 0, 0) '// ROTATION
glTranslatef(0, 0, -rH) '// TRANSLATION
if (nAnimate) then rPenSize = 2 else rPenSize = 1
nPixStep = 2
for y = 0 to nH - 1 step nPixStep
for x = 0 to nW -1 step nPixStep
zSplitColorARGB(PixColor(x, y), A, R, G, B)
if (A) then
rSize = rAlpha(x, y) * nMove
'gl_dLine(rX1 - rW + x, rY1, rX1 - rW + x, rY1 - rSize, PixColor(x, y), rPenSize)
gl_dPoint(rX1 - rW + x, rY1 - rSize, PixColor(x, y))
glTranslatef(0, 0, nPixStep) '// TRANSLATION
The scene has been setup to render the 3D image to match exactly the pixel resolution of the 2D image, when shown in front of the camera.