Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10425 in orxonox.OLD


Ignore:
Timestamp:
Jan 28, 2007, 1:08:54 AM (17 years ago)
Author:
stefalie
Message:

blink: 1 bug less

Location:
branches/blink/src/world_entities/effects
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/blink/src/world_entities/effects/billboard.cc

    r10407 r10425  
    152152  {
    153153    //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
    155157  }
    156158
  • branches/blink/src/world_entities/effects/blink.cc

    r10407 r10425  
    11/*
    2    orxonox - the future of 3D-vertical-scrollers
    32
    43   Copyright (C) 2006 orx
     
    5049Blink::~Blink ()
    5150{
    52   if (this->material)
    53     delete this->material;
     51//  if (this->material)
     52  //  delete this->material;
    5453}
    5554
     
    6564  this->toList(OM_COMMON);
    6665
    67   this->material = new Material();
     66  //this->material = new Material();
    6867  //this->material->setIllum(0);
    6968  //this->material->setDiffuse(1.0,1.0,1.0);
     
    7372  //this->material->setBlendFunc(GL_ZERO,GL_ZERO);
    7473  //this->material->setDiffuseMap("pictures/rblink2.png");
    75   this->material->setDiffuseMap("maps/star_alpha.png");
     74  //this->material->setDiffuseMap("maps/star_alpha.png");
    7675  //this->setAbsCoor(0, 0, 0);d
    7776  //this->setVisibiliy(true);
     
    9089  this->setAbsCoor(0, 0, 0);
    9190  this->position = Vector(0, 0, 0); ///remove
    92   this->color = Vector(255, 255, 255);
     91  this->color = Color(1, 1, 0);
    9392  this->size = 10;
    9493  this->omega = 10;
     
    151150void Blink::draw() const
    152151{
    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();
    158157
    159158//   Vector pos = this->getAbsCoor();
     
    179178//   glShadeModel(GL_SMOOTH);
    180179
    181 
     180/*
    182181  Vector camCoor = State::getCameraNode()->getAbsCoor();
    183182  Vector diff = camCoor - this->position;
     
    186185  //glTranslatef(position.x + size/2, position.y + size/2, position.z);
    187186
    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);*/
    189188
    190189//   Vector view = this->getAbsCoor() - State::getCameraNode()->getAbsCoor();
     
    194193//   Vector h = view.cross(up);
    195194
    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));
    207198
    208199  glPopMatrix();
  • branches/blink/src/world_entities/effects/blink.h

    r10407 r10425  
    88#include "world_entity.h"
    99#include "effects/billboard.h"
     10#include "color.h"
    1011
    1112class Material;
     
    2627    void setSize(float s) { this->size = s; this->bBoard->setSize(this->size, this->size); }
    2728    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); }
    2930    //void setTexture(const std::string& textureFile);
    3031
     
    3334
    3435  private:
    35     Material*         material;
     36    //Material*         material;
    3637    Billboard*        bBoard;
    3738    Vector            position;
    38     Vector            color;
     39    Color             color;
    3940    float             angle;
    4041    float             omega;
Note: See TracChangeset for help on using the changeset viewer.