19/2/07, pm-n.
Week: 8 ( 19/2 - 23/2 )
Lectures:
Example programs:
The directory /users/pmn/public/cgf07/week8 contains
the following programs:
- main_texture takes one parameter which is the name of a file
which contains a full-color image in bmp-format. The image is used to
texture an oscillating surface ( see week 7 ).
- main_texture_alpha takes two parameters. The first is an image in
full-color and the second is a grey-tone image ( both in bmp-format ).
The two images combine into a single image with four channels, an r-
a g- a b- and an alpha-channel. This image is used to texture an
oscillating surface.
- main_texture_2 takes three parameters. All three are images in
bmp-format. The first and the third are full-color images and the
second is a grey-tone image. The first two images combine ( as for
main_texture_alpha ) and are applied as texture for an oscillating
surface which is displaed in front of an other oscillating surface
textured with the third image.
- main_texture_morph takes two parameters. Both are full-color
images. A time dependent mixture of the images is used to texture
an oscillating surface.
An image must be in bmp-format ( although not all variants are
accepted ). The size ( in the x-direction as well as in the y-direction )
must be a power of two. Images that are combined into a single image
( with four channels ) or are mixed must have equal sizes.
The program xv3 can be used to change size and format of an image
and to perform some basic image manipulations. The program can be
copied ( or executed ) from /users/pmn/bin/xv3.linux, and a
short 'helpsheet' is available
here.
Exercises:
- Apply a suitable texture to the boids of your project.
- Make some changes to the class morphingTexture. E.g.:
Change the mixing in bind(...) or enable mixing of three or more images.
Reading:
- OpenGL, Programming Guide ( "The red book" )
Chapter 9, Texture Mapping, from the start to'Texture Proxy',
'Texture Objects', 'Texture Functions' and 'Assigning Texture
Coordinates'.
Chapter 6, Blending,..., Blending.