Changeset 3420 in orxonox.OLD for orxonox/trunk/src/skysphere.cc
- Timestamp:
- Feb 22, 2005, 8:14:18 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/skysphere.cc
r3419 r3420 54 54 Skysphere::~Skysphere() 55 55 { 56 delete sky ;56 delete skyMaterial; 57 57 free(sphereObj); 58 58 } … … 64 64 void Skysphere::initialize(char* fileName) 65 65 { 66 sphereObj=gluNewQuadric(); 67 gluQuadricTexture(sphereObj,GL_TRUE); 68 sky = new Material("Sky"); 69 sky->setDiffuseMap(fileName); 70 sky->setIllum(3); 71 sky->setAmbient(.5, .5, 1.0); 66 this->sphereObj = gluNewQuadric(); 67 gluQuadricTexture(this->sphereObj, GL_TRUE); 68 this->setRadius(250.0); 69 70 this->skyMaterial = new Material("Sky"); 71 this->setTexture(fileName); 72 this->skyMaterial->setIllum(3); 73 this->skyMaterial->setAmbient(.5, .5, 1.0); 74 } 75 76 /** 77 \brief sets the Radius of the Sphere. 78 \param radius The Radius of The Sphere 79 */ 80 void Skysphere::setRadius(float radius) 81 { 82 this->sphereRadius = radius; 83 } 84 85 /** 86 \brief Defines which texture should be loaded onto the skysphere. 87 \param fileName The filename of the Texture 88 */ 89 void Skysphere::setTexture(char* fileName) 90 { 91 this->skyMaterial->setDiffuseMap(fileName); 72 92 } 73 93 … … 93 113 void Skysphere::draw() 94 114 { 95 sky ->select();115 skyMaterial->select(); 96 116 glPushMatrix(); 97 117 glTranslatef(this->sphereCenter.x,this->sphereCenter.y,this->sphereCenter.z); 98 118 99 glRotatef(-30, 1,0,0);100 glRotatef(95.0f, 0.0f,0.0f,1.0f);101 glRotatef(-250.0f, 0.0,1.0f,0.0f);119 glRotatef(-30, 1, 0, 0); 120 glRotatef(95.0f, 0.0f, 0.0f, 1.0f); 121 glRotatef(-250.0f, 0.0, 1.0f, 0.0f); 102 122 103 gluSphere(sphereObj, 200.0f,20,20);123 gluSphere(sphereObj, sphereRadius, 20, 20); 104 124 glPopMatrix(); 105 125 }
Note: See TracChangeset
for help on using the changeset viewer.