sources:


website:
more info here


screenshot:
studies/grafik2/Computergrafik-Code9/Aufgabe25/cgtexture.h
download file

  1 //
  2 // Computergraphik II
  3 // Prof. Dr. Juergen Doellner
  4 // Wintersemester 2001/02
  5 //
  6 // Rahmenprogramm zu Aufgabenzettel 9
  7 //
  8
  9 #ifndef CG_TEXTURE_H
 10 #define CG_TEXTURE_H
 11
 12 #include "cgapplication.h"
 13 #include "vector.h"
 14
 15 class CGTexture : public CGApplication {
 16 public:
 17     CGTexture();
 18     virtual ~CGTexture();
 19
 20     virtual void onInit();
 21     virtual void onDraw();       
 22     virtual void onIdle();
 23     virtual void onKey(unsigned char key);   
 24     virtual void onSize(unsigned int newWidth, unsigned int newHeight);
 25
 26     void readImage();
 27
 28     // value Methode
 29     unsigned char value(int x, int z) const;
 30    
 31 private:
 32     void drawScene();
 33     void drawObject();
 34     void buildPatch(int detail);
 35
 36     void createNoiseTexture3D();
 37
 38     // Dimensionen des Viewports
 39     int width_;
 40     int height_;
 41
 42     // Display-List
 43     GLint torus_;
 44     bool usetorus_;
 45
 46     // Zoom
 47     double zoom_;
 48
 49     // Dimensionen der Textur
 50     int texWidth_;
 51     int texHeight_;
 52     int texDepth_;
 53
 54     // Texture ID
 55     GLuint texName1_;
 56     GLuint texName2_;
 57     GLuint texName3_;
 58
 59     // Rotation
 60     bool run_;
 61 };
 62
 63 #endif // CG_WAVE_H
 64