Changeset 10253 in orxonox.OLD for branches/blink/src/world_entities/effects
- Timestamp:
- Jan 17, 2007, 1:51:22 PM (18 years ago)
- Location:
- branches/blink/src/world_entities/effects
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/blink/src/world_entities/effects/blink.cc
r10175 r10253 18 18 #include "util/loading/factory.h" 19 19 #include "debug.h" 20 20 #include "state.h" 21 21 22 22 #include "material.h" … … 68 68 // this->material->setSpecular(0.0,0.0,0.0); 69 69 // 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"); 72 73 //this->setAbsCoor(0, 0, 0);d 73 74 //this->setVisibiliy(true); 74 75 // this->setSize(5, 5); 76 77 this->setAbsCoor(0, 0, 0); 78 this->position = Vector(0, 0, 0); ///remove 79 this->size = 10; 75 80 } 76 81 … … 82 87 void Blink::loadParams(const TiXmlElement* root) 83 88 { 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); 84 104 /*LoadParam(root, "texture", this->material, Material, setDiffuseMap) 85 105 .describe("the texture-file to load onto the Blink"); … … 107 127 glDisable(GL_LIGHTING); 108 128 glDisable(GL_FOG); 129 glMatrixMode(GL_MODELVIEW); 109 130 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); 110 162 111 163 this->material->select(); 112 164 165 166 glColor4ub(255, 0, 0, 255); 113 167 glBegin(GL_QUADS); 114 168 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); 118 172 glEnd(); 119 173 -
branches/blink/src/world_entities/effects/blink.h
r10175 r10253 21 21 void loadParams(const TiXmlElement* root); 22 22 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; } 24 25 //void setTexture(const std::string& textureFile); 25 26 … … 28 29 29 30 private: 30 Material* material; 31 Material* material; 32 Vector position; 33 float size; //! only one float caus' its quadratical 31 34 }; 32 35
Note: See TracChangeset
for help on using the changeset viewer.