Zanir » OpenGL

Archive for the ‘OpenGL’ Category

Program 11 – Blending

25.05.2002

011_blendingBlending is used to combine the color of a given pixel that is about to be drawn with the pixel that is already on the screen.

Blending is setting through:
glEnable(GL_BLEND); and glDisable(GL_BLEND);

The Blending Equation is set:
glBlendFunc( source factor, destination factor );

source code (without jpeg.lib) and executable – 250kB

Program 10 – Multi-texturing

25.05.2002

010_multitexturingMulti-texturing – the ability to apply two or more distinct textures to a single fragment. I use two texture units. Each texture unit has its own texture coordinates.
Multi-texture makes it possible to use light-map in one pass. Many OpenGL games such as Quake and Unreal use light maps to improve the lighting quality within their scenes. Multi-texture is often uses on bump-mapping.

Request: GL_ARB_multitexture and GL_ARB_texture_env_add.

source code (with jpeg.lib) and executable – 262 kB

Program 9 – Height map

21.04.2002

009_fxz_surfaceHeight map is picture, that intensity of color represent height of terrain.

source code and program – 313kB

Program 8 – Rotated surface

09.01.2002

008_rotated_surfaceProgram draws:
cylinder, cone, sphere, one-part rotated hyperboloid, anuloid, rotated elipsoid, rotated paraboloid, rotated function sinus and rotated Bezier curve.
All surfaces has textures, are lighting and are animate.

source code and executable – 111kB

Program 7 – Modeling curves

05.01.2002

000_ZakladProgram has ability to modeling Ferguson and Bezier curves.

source code and program – 51kB

Program 6 – 2D curves

05.01.2002

000_ZakladProgram draws:
Bezier curves, Circle, Ellipse, Parabole, Hyperbola, Ortocykloida, Epicykloida, Hypocykloida, Evolvent of circle, Lemniskat of Bernoulli, Descartes leaf, and Archimedes spiral.

source code and executable – 58kB

Program 5 – Drawing basic 3D objects

05.01.2002

000_ZakladAll these objecs draw by glu (OpenGL Utility library).

source code and program – 99kB

Program 4 – Using display list and fog

05.01.2002

000_ZakladDisplay list contains list of operation.

source code and program – 96kB

Program 3 – Lighting and Moving in space

05.01.2002

000_ZakladFor lighting are important vectors to perpendicular on surfaces (normal vectors). These vectors are use to compute lighting.
Program draws cube two ways:
First cube (at left) has one normal vector on side.
Second cube (at right) has one normal vector on vertex.

source code and executable – 95kB

Program 2 – Bitmap Fonts and FPS

05.01.2002

000_ZakladPress key ‘h’ to show help. This goes for all further programs.

source code and executable – 47kB