Latest

Archive

Community news

C++

Communities and Content

Databases

Editorials

Emacs

General

HTML

Java

Notices

PHP

XML

Apache

C++

Database

General

HTML

Java

Javascript

Linux

Object oriented programming

Open source

Perl

PHP

Python

Ruby

SOAP

XML

Suggest a link

Advertise on zez

Contribute

Contact us

About zez


Building 3D worlds with OpenGL




buildLandscape()


This function is to long to be shown in detail here, but I'll explain its main points: It uses a double for loop to loop through each point in the height field. For each point, it checks the surrounding points to see if it should split the square into two triangles, and if so, which of the two possible diagonals it should use. It must also calculate the surface normal for each square or triangle, this is set with the glNormal3f() function. The surface normal is a vector at 90 degrees to the square/triangle. It is used to calculate how light reflects off surfaces.

Grab the source


This is all you need to build OpenGL worlds with Qt. Now, if you do a search for "OpenGL" and "tutorial" on the net, hopefully you'll be able to follow some of the more advanced tutorials out there. Oh, and by the way, here is the source:

qgl-demo.tar.gz (11 kb)
Released under the GPL.
Requires: Qt and tmake, available from TrollTech.
Qt must be compiled with OpenGL enabled.

Build instructions:

tar -zxf qgl-demo.tar.gz
cd qgl-demo
tmake -o Makefile qgl-demo.pro
make
./qgl-demo


If you have any questions, please post a comment to this article!


<< Previous page | 1 | 2 | 3 | 4 | 5 | < 6 > | Printer-friendly page |

Comment List


Topic: Author:
Time:
Beginner's tutorials Johann Fuchs 13.02.2001 17:04

if you want to learn opengl programming from the scratch
to high level you should look at

http://nehe.gamedev.net

which is quite an excellent site IMHO.




Forgot your password?

Register a new user

Results

Polls