Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10253 in orxonox.OLD


Ignore:
Timestamp:
Jan 17, 2007, 1:51:22 PM (17 years ago)
Author:
stefalie
Message:
 
Location:
branches/blink/src/world_entities/effects
Files:
2 edited

Legend:

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

    r10175 r10253  
    1818#include "util/loading/factory.h"
    1919#include "debug.h"
    20 
     20#include "state.h"
    2121
    2222#include "material.h"
     
    6868 // this->material->setSpecular(0.0,0.0,0.0);
    6969 // this->material->setAmbient(1.0, 1.0, 1.0);
    70   this->material->setBlendFunc(GL_ZERO,GL_ZERO);
    71   this->material->setDiffuseMap("maps/acid3.png");
     70  //this->material->setBlendFunc(GL_ZERO,GL_ZERO);
     71  //this->material->setDiffuseMap("pictures/rblink2.png");
     72  this->material->setDiffuseMap("maps/star.bmp");
    7273  //this->setAbsCoor(0, 0, 0);d
    7374  //this->setVisibiliy(true);
    7475  // this->setSize(5, 5);
     76
     77  this->setAbsCoor(0, 0, 0);
     78  this->position = Vector(0, 0, 0); ///remove
     79  this->size = 10;
    7580}
    7681
     
    8287void Blink::loadParams(const TiXmlElement* root)
    8388{
     89  WorldEntity::loadParams(root);
     90
     91  LoadParam(root, "position", this, Blink, setPosition);
     92  LoadParam(root, "size", this, Blink, setSize);
     93//   LoadParam(root, "watersize", this, Blink, setWaterSize);
     94//   LoadParam(root, "wateruv", this, Blink, setWaterUV);
     95//   LoadParam(root, "waterflow", this, Blink, setWaterFlow);
     96//   LoadParam(root, "lightpos", this, Blink, setLightPos);
     97//   LoadParam(root, "waterangle", this, Blink, setWaterAngle);
     98//   LoadParam(root, "normalmapscale", this, Blink, setNormalMapScale);
     99//   LoadParam(root, "shinesize", this, Blink, setShineSize);
     100//   LoadParam(root, "shinestrength", this, Blink, setShineStrength);
     101//   LoadParam(root, "reflstrength", this, Blink, setReflStrength);
     102//   LoadParam(root, "refraction", this, Blink, setRefraction);
     103//   LoadParam(root, "watercolor", this, Blink, setWaterColor);
    84104  /*LoadParam(root, "texture", this->material, Material, setDiffuseMap)
    85105      .describe("the texture-file to load onto the Blink");
     
    107127  glDisable(GL_LIGHTING);
    108128  glDisable(GL_FOG);
     129  glMatrixMode(GL_MODELVIEW);
    109130  glPushMatrix();
     131
     132//   Vector pos = this->getAbsCoor();
     133//   Vector dir = pos - State::getCameraNode()->getAbsCoor();
     134//   dir.normalize();
     135//
     136//   Vector up = Vector(0, 1, 0);
     137//   Vector h = dir.cross(up);
     138//
     139//   Vector pos = this->getAbsCoor();
     140//   glTranslatef(pos.x, pos.y, pos.z);
     141
     142    /* translate */
     143//     glTranslatef (this->getAbsCoor ().x,
     144//                   this->getAbsCoor ().y,
     145//                   this->getAbsCoor ().z);
     146//     Vector tmpRot = this->getAbsDir().getSpacialAxis();
     147//     glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
     148
     149  glBlendFunc(GL_SRC_ALPHA,GL_ONE); // Set The Blending Function For Translucency
     150  glEnable(GL_BLEND);
     151  glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
     152
     153  //glTranslatef(position.x + size/2, position.y + size/2, position.z);
     154
     155  glTranslatef(this->position.x - this->size/2, this->position.y - this->size/2, this->position.z);
     156
     157//   Vector view = this->getAbsCoor() - State::getCameraNode()->getAbsCoor();
     158//   view.normalize();
     159//
     160//   Vector up = Vector(0, 1, 0);
     161//   Vector h = view.cross(up);
    110162
    111163  this->material->select();
    112164
     165
     166  glColor4ub(255, 0, 0, 255);
    113167  glBegin(GL_QUADS);
    114168    glTexCoord2f(1, 1); glVertex3f(0, 0, 0);
    115     glTexCoord2f(1, 0); glVertex3f(1000, 0, 0);
    116     glTexCoord2f(0, 0); glVertex3f(1000, 1000, 0);
    117     glTexCoord2f(0, 1); glVertex3f(0, 1000, 0);
     169    glTexCoord2f(1, 0); glVertex3f(this->size, 0, 0);
     170    glTexCoord2f(0, 0); glVertex3f(this->size, this->size, 0);
     171    glTexCoord2f(0, 1); glVertex3f(0, this->size, 0);
    118172  glEnd();
    119173
  • branches/blink/src/world_entities/effects/blink.h

    r10175 r10253  
    2121    void loadParams(const TiXmlElement* root);
    2222
    23     //void setSize(float sizeX, float sizeY);
     23    void setPosition(float x, float y, float z) { this->position = Vector(x, y, z); }
     24    void setSize(float s) { this->size = s; }
    2425    //void setTexture(const std::string& textureFile);
    2526
     
    2829
    2930  private:
    30     Material*        material;
     31    Material*         material;
     32    Vector            position;
     33    float             size;             //! only one float caus' its quadratical
    3134};
    3235
Note: See TracChangeset for help on using the changeset viewer.