Project Information
Modelling Seashells
Graphics with OpenGL:
The Basics:
Documentation on the graphics routines/library is available:
- OpenGL (the graphics library)
- MESA (a graphics library like OpenGL)
- Information on theGLUT, also GLUT FAQ.
Your code which contains calls to graphics routines will need to have the following includes:
- #include <glut.h>
- #include <glu.h>
- #include <gl.h>
To link to the graphics library in your code add the following to your makefile:
-I/usr/include/GL -lGL -lglut -lGLU The above (I)nclude tells the compiler where to look for special #include files. The above (l)inks to the (l)ibraries for the graphics routines. E.g. A simple compile looks like this...
g++ -I/usr/include/GL somefile.c somefile2.c -lGL -lglut -lGLU(But use a makefile, not a command-line compile like this! Of course you might also need to link to some other libraries such as the maths library - just put these in before the links to the graphics libraries.)
The graphics code can be downloaded now (save the file as a text file)!
- It contains a simple OpenGL application which can be compiled and executed 'as-is' to draw a couple of squares on the screen.
- Instructions are included in the comments of the code describing how to make it work.
- Before you try to make it work with your world, compile the code 'as-is' and get it running.
Experiment with the code to see how it works. Study the OpenGL documentation online and in the library to see what the functions do... then save a copy of your world and a copy of the OpenGL code in a directory and see if you can fit the two programs together.
- A good reference: Neider, Davis, Woo, OpenGL Programming Guide, Addison-Wesley Publishing (get the latest edition) and consult the web sites above.
[ Rendering | Project Information Top | Project Home Page ]
Last updated:March 2, 2001 6:33 PM | Maintained by: |