next up previous contents index
Next: Lightsource Handling Up: GraphicDevice Previous: Display Lists

Texturing

The texture functions are experimental and only implemented in the OpenGL driver for now, in a somehow hardware dependent way. So do not use them if you are interested in images with a higher than screen resolution.

void texture_init (unsigned char *, unsigned int, int, int)
This is used to define a texture by dev->texture_init (&Image[0][0][0], G_RGB, imageWidth, imageHeight); here Image is a matrix of size imagewidth*imageheight*3: unsigned char Image[imagewidth][imageheight][3]; the integers imagewidth, imageheight are the width and the height of the image. Notice that imagewidth, imageheight are numbers of the form  tex2html_wrap_inline45976 and the smallest number is 64. For better use take imagewidth = imageheight.

void texture_coord (double, double)
This function has to be called during patch generation, i.e. between subsequent calls of patch_vertex(). After defining a texture with void (*texture_init) you can define a point in texture space  tex2html_wrap_inline45980 with dev->texture_coord(xp,yp); here xp, yp are double values between 0.0 and 1.0. Then you define a point in your image space  tex2html_wrap_inline45986 with dev->patch_vertex(pkt); here pkt is of type VEC3.



SFB 256 Universität Bonn and IAM Universität Freiburg

Copyright © by the Sonderforschungsbereich 256 at the Institut für Angewandte Mathematik, Universität Bonn.