Changeset 10425 in orxonox.OLD for branches/blink/src/world_entities/effects
- Timestamp:
- Jan 28, 2007, 1:08:54 AM (18 years ago)
- Location:
- branches/blink/src/world_entities/effects
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/blink/src/world_entities/effects/billboard.cc
r10407 r10425 152 152 { 153 153 //glColor4ub((int)(this->texColor->r() * 255), (int)(this->texColor->g() * 255), (int)(this->texColor->b() * 255), (int)(this->texColor->a() * 255)); 154 glColor4ub(255, 0, 0, 255); 154 glColor4ub((GLubyte)this->texColor->r()*255, (GLubyte)this->texColor->g()*255, (GLubyte)this->texColor->b()*255, 255); 155 PRINTF(0)("\n\n\n\n::%f,%f,%f\n\n\n\n", this->texColor->r()*255, this->texColor->g()*255, this->texColor->b()*255); 156 155 157 } 156 158 -
branches/blink/src/world_entities/effects/blink.cc
r10407 r10425 1 1 /* 2 orxonox - the future of 3D-vertical-scrollers3 2 4 3 Copyright (C) 2006 orx … … 50 49 Blink::~Blink () 51 50 { 52 if (this->material)53 delete this->material;51 // if (this->material) 52 // delete this->material; 54 53 } 55 54 … … 65 64 this->toList(OM_COMMON); 66 65 67 this->material = new Material();66 //this->material = new Material(); 68 67 //this->material->setIllum(0); 69 68 //this->material->setDiffuse(1.0,1.0,1.0); … … 73 72 //this->material->setBlendFunc(GL_ZERO,GL_ZERO); 74 73 //this->material->setDiffuseMap("pictures/rblink2.png"); 75 this->material->setDiffuseMap("maps/star_alpha.png");74 //this->material->setDiffuseMap("maps/star_alpha.png"); 76 75 //this->setAbsCoor(0, 0, 0);d 77 76 //this->setVisibiliy(true); … … 90 89 this->setAbsCoor(0, 0, 0); 91 90 this->position = Vector(0, 0, 0); ///remove 92 this->color = Vector(255, 255, 255);91 this->color = Color(1, 1, 0); 93 92 this->size = 10; 94 93 this->omega = 10; … … 151 150 void Blink::draw() const 152 151 { 153 glPushAttrib(GL_ENABLE_BIT);154 glEnable(GL_LIGHTING); //glDisable(GL_LIGHTING);155 glDisable(GL_FOG);156 glMatrixMode(GL_MODELVIEW);157 glPushMatrix();152 // glPushAttrib(GL_ENABLE_BIT); 153 // glEnable(GL_LIGHTING); //glDisable(GL_LIGHTING); 154 // glDisable(GL_FOG); 155 // glMatrixMode(GL_MODELVIEW); 156 // glPushMatrix(); 158 157 159 158 // Vector pos = this->getAbsCoor(); … … 179 178 // glShadeModel(GL_SMOOTH); 180 179 181 180 /* 182 181 Vector camCoor = State::getCameraNode()->getAbsCoor(); 183 182 Vector diff = camCoor - this->position; … … 186 185 //glTranslatef(position.x + size/2, position.y + size/2, position.z); 187 186 188 glTranslatef(this->position.x - this->size/2, this->position.y - this->size/2, this->position.z); 187 glTranslatef(this->position.x - this->size/2, this->position.y - this->size/2, this->position.z);*/ 189 188 190 189 // Vector view = this->getAbsCoor() - State::getCameraNode()->getAbsCoor(); … … 194 193 // Vector h = view.cross(up); 195 194 196 this->material->select(); 197 198 this->bBoard->colorTexture(Color(1, 0, 0, 0)); 199 //glColor4ub(this->color.x, this->color.y, this->color.z, 127.5*(this->blinkStr + 1)); 200 // glBegin(GL_QUADS); 201 // glTexCoord2f(1, 1); glVertex3f(0, 0, 0); 202 // glTexCoord2f(1, 0); glVertex3f(this->size, 0, 0); 203 // glTexCoord2f(0, 0); glVertex3f(this->size, this->size, 0); 204 // glTexCoord2f(0, 1); glVertex3f(0, this->size, 0); 205 // glEnd(); 206 195 //this->material->select(); 196 PRINTF(0)("\n\n\n\n::%f,%f,%f\n\n\n\n", color.r(), color.g(), color.b()); 197 this->bBoard->colorTexture(Color(color.r(), color.g(), color.b(), 1)); 207 198 208 199 glPopMatrix(); -
branches/blink/src/world_entities/effects/blink.h
r10407 r10425 8 8 #include "world_entity.h" 9 9 #include "effects/billboard.h" 10 #include "color.h" 10 11 11 12 class Material; … … 26 27 void setSize(float s) { this->size = s; this->bBoard->setSize(this->size, this->size); } 27 28 void setOmega(float w) { this->omega = w; } 28 void setColor(float r, float g, float b) { this->color = Vector(r, g, b); }29 void setColor(float r, float g, float b) { this->color = Color(r/255, g/255, b/255); } 29 30 //void setTexture(const std::string& textureFile); 30 31 … … 33 34 34 35 private: 35 Material* material;36 //Material* material; 36 37 Billboard* bBoard; 37 38 Vector position; 38 Vectorcolor;39 Color color; 39 40 float angle; 40 41 float omega;
Note: See TracChangeset
for help on using the changeset viewer.