Changeset 3440 in orxonox.OLD for orxonox/trunk
- Timestamp:
- Mar 1, 2005, 8:55:53 PM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/light.cc
r3438 r3440 35 35 36 36 glEnable (GL_LIGHTING); 37 this->setAmbientColor(.3, .3, .3); 37 38 this->lights = new LightValue*[NUMBEROFLIGHTS]; 38 39 for (int i = 0; i < NUMBEROFLIGHTS; i++) … … 248 249 } 249 250 251 /** 252 \brief sets the ambient Color of the Scene 253 \param r red 254 \param g green 255 \param b blue 256 */ 257 void Light::setAmbientColor(GLfloat r, GLfloat g, GLfloat b) 258 { 259 this->ambientColor[0] = r; 260 this->ambientColor[1] = g; 261 this->ambientColor[2] = b; 262 this->ambientColor[3] = 1.0; 263 264 glLightfv (GL_LIGHT0, GL_AMBIENT, this->ambientColor); 265 266 } 267 250 268 // get Attributes 251 269 -
orxonox/trunk/src/light.h
r3437 r3440 34 34 GLfloat diffuseColor[4]; //!< The Diffuse Color this Light emmits. 35 35 GLfloat specularColor[4]; //!< The specular Color of this Light. 36 GLint attenuationType; //!< The AttenuationType of this Light. \todo implements this; 36 37 37 38 LightValue* next; … … 39 40 40 41 static Light* singletonRef; //!< This is the LightHandlers Reference. 42 GLfloat ambientColor[4]; //!< The ambient Color of the scene. 43 44 41 45 Light(void); 42 46 … … 60 64 void setDiffuseColor(GLfloat r, GLfloat g, GLfloat b); 61 65 void setSpecularColor(GLfloat r, GLfloat g, GLfloat b); 66 void setAmbientColor(GLfloat r, GLfloat g, GLfloat b); 62 67 // get Attributes 63 68 Vector getPosition(void); -
orxonox/trunk/src/world.cc
r3439 r3440 878 878 this->localCamera->timeSlice(dt); 879 879 this->trackManager->tick(dt); 880 this->light->setPosition(10*cos((double)currentFrame/1000),10, 10*sin((double)currentFrame/1000));881 this->light->setDiffuseColor(.5-.5*cos((double)currentFrame/1000), .5+sin((double)currentFrame/1000), .5+sin((double)currentFrame/1000));882 this->light->setSpecularColor(.5-.5*sin((double)currentFrame/1000), .5+sin((double)currentFrame/1000), .5+cos((double)currentFrame/1000));883 880 } 884 881 this->lastFrame = currentFrame;
Note: See TracChangeset
for help on using the changeset viewer.