sources:


website:
more info here


screenshot:
studies/grafik2/Computergrafik-Code9/Aufgabe24/cgprojtexture.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_PROJTEXTURE_H
 10 #define CG_PROJTEXTURE_H
 11
 12 #include "cgapplication.h"
 13 #include "vector.h"
 14
 15 class CGProjTexture : public CGApplication {
 16 public:
 17     CGProjTexture(char* filename);
 18     virtual ~CGProjTexture();
 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 private:
 29
 30     void drawScene();
 31     void drawObject();
 32
 33     // dimension of viewport
 34     int width_;
 35     int height_;
 36
 37     // size of mesh
 38     double zoom_;
 39
 40     // filename of ppm-image
 41     char* filename_;
 42
 43     // dimension of texture
 44     int texWidth_;
 45     int texHeight_;
 46     // image for texture
 47     GLubyte* image_;;
 48     // texture identifier
 49     GLuint texName_;
 50
 51     bool run_;
 52
 53     float angle_; // Öffnungswinkel der projektiven Textur
 54     // Das Zentrum der Projektion liegt auf einer Kugel um den Ursprung
 55     // an einer durch Längengrad und Breitengrad gekennzeichneten Position.
 56     float radius_;// Radius der Kugel
 57     float theta_; // Längengrad [0, 2*pi]
 58     float phi_;   // Breitengrad [-pi/2, pi/2]
 59 };
 60
 61 #endif
 62
 63
 64