Rendering a 3D terrain

This is a sample screen of the common technique in 3D graphics - use the grey scale intensity of a bmp file to make a virtual terrain; uses bmp for heightmap, virtual terrain renderer, great for 3D effects, shows the possiblities of D3D in Rapidq.

The idea comes from an OpenGL tutorial by DigiBen at www.GameTutorials.com, which is a great site for programming infomation, not just games.. Some of the textures are his. Other textures were generated by Terragen, an awesome raytracing program for realistic landscapes.

There are a few Heightmap files that can be ADDED to make a large and detailed scene. This is much faster than loading one big BMP file because QD3DmeshBuilder is very slow.  This code is a good resource of learning DirectX retained mode graphics programming.

RapidQ Source  code:
RapidQ 3D include file:
Download sample app:

Vista /Win 7/Win 8 users: you will need to download this DLL file. Unpack it and put it in the same folder as the program.
Details:
Direct3D  retained mode is no longer in further development by Microsoft, but was still be supported by newer DirectX/3D releases. The reason why it is called retained mode is that all the 3D information ( vertices, texture coordinates, normals) are stored in fixed memory and cannot be changed rapidly. This type of rendering is good for objects with fixed geometry. The fokker model comes from the OpenFx Project. An excellent 3D modeling program.

3D retro game

What programming language doesn't have a PONG spinoff? This program is a 3-D version of the old PONG game - - except it has a rotating court inside a huge sphere! The  code demonstrates simple ways to put together a full screen game, using Direct3D. The include file has several custom components inside it, for instance the QD3DPrimative, which makes simple 3D structures as boxes, spheres, cones, planes, and cylinders. They are made up of 3D faces. You will notice that they have dull surface material properties,  rather than shiny with light hot spots. This is because of a limitation in RapidQ Direct3D that does not let you specify the surface normals (perpendicular direction to the face for calculating light reflectance).  Another thing you will notice is the use of QD3DCloneMesh a way to make multiple copies of a 3D object (the 'semi-transparent particles.')

RapidQ Source  code:
RapidQ 3D include file:
Sample app

Vista /Win 7/Win 8 users: you will need to download this DLL file. Unpack it and put it in the same folder as the program.
Details:
The original code for this came from a 2D PONG game written in Basic4GL. Another great BASIC-like programming language that has built-in OpenGL support.

Head MRI viewer in 3D

I wrote this program for a demo to see what would happen if you put together a bunch of MRI (magnetic resonance images) of a head together, make them semi-transparent and then rotate them in 3D. Well, not much, but it was cool nonetheless. I gave up on this after I saw the completely awesome and free OSIRIX project!

The example shows several tricks such as quick image sementation by grey scale level using BitBLT (.Draw command in RapidQ), creating a plane voxel by QD3DMesh, and alpha-transparency.

RapidQ Source code:

Sample program
MRI images courtesy ImageJ

Vista /Win 7/Win 8 users: you will need to download this DLL file. Unpack it and put it in the same folder as the program.


Details:  You can download sample MRI images off the web such as ImageJ, which is where I got these. The MRI images have to be saved in sequence, and must be in dimensions of a power of 2 (ie, 256x256 pixels).

Dterr
(Dynamic Terrain)

This was a demonstration program for 3D scene visualization for navagation and localization in  unfamiliar  environments. The code is not for public release. I have some screen shots to show you the power of RapidQ in 3D.

The lower left button launches an Internet explorer window, that links with DEM files for downloading and subsequently rendering the heightmap information. The camera button to the right starts a web cam for eye tracking! Yes that is right the view is moved by your eye movements in real time (or at least at the speed of the render). In this version it is rendered by a 1 GHz celeron using standard Intel video (why the Frames/second is rather low.)

Not seen in the images are many capabilities, such as pasting images from the web cam directly onto the terrain, generating real 3D-stereo views, nighttime rendering  with spot lights,   flying, driving, and hovering views.

For a demo program that is a barebones version without all options, click here: This program requires at least a P4 processor with a 32MB 3d video card, DirectX 6 or higher, and at least 128 MB Ram

Vista /Win 7/Win 8 users: you will need to download this DLL file. Unpack it and put it in the same folder as the program.

 

Details:
Most of the code is native RapidQ, with some help of custom DLLs for use in eye tracking in real time. RapidQ was much too slow for locating the pupil of the eye and calculating its position.


Boris' DEA engine with new modifications

All work and no play means breaking out and playing with some 3D code in RapidQ!


For a demo program with code, click here: This program requires at least a P4 processor with a 32MB 3d video card, DirectX 6 or higher. You will need about 50Mb of free RAM.

Vista /Win 7/Win 8 users: you will need to download this DLL file. Unpack it and put it in the same folder as the program.


Details:
All code is native RapidQ. this shows how to use the D3DCloneMesh to render lots of the same model. The models were supplied by Boris Holyguard and made with the Dele 3D engine (http://delgine.com).

Notice the code uses a QTimer to do some background calculations. I get frame rates up to 30 - 50 / second on a Celeron 1.2 Ghz.




 



Made with Nvu