Changeset 7532 in orxonox.OLD for branches/atmospheric_engine/src/lib/graphics/effects
- Timestamp:
- May 4, 2006, 1:58:22 PM (19 years ago)
- Location:
- branches/atmospheric_engine/src/lib/graphics/effects
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/atmospheric_engine/src/lib/graphics/effects/atmospheric_engine.cc
r7519 r7532 75 75 PRINTF(4)("element is: %s\n", element->Value()); 76 76 Factory::fabricate(element); 77 77 78 78 BaseObject* bo = Factory::fabricate(element); 79 79 if( bo == NULL) -
branches/atmospheric_engine/src/lib/graphics/effects/volfog_effect.cc
r7530 r7532 22 22 #include "shell_command.h" 23 23 24 /*#define NUM_PANELS 6;25 26 typedef struct27 {28 float x;29 float y;30 float z;31 } world_vector;32 33 world_vector vertices[NUM_PANELS*4] = {34 {-50.0, -60.0, 0.0},{50.0, -60.0, 0.0},{50.0, 0.0, 0.0},{-50.0, 0.0, 0.0},35 {-50.0, -60.0, 60.0},{-50.0, -60.0, 0.0},{-50.0, 0.0, 0.0},{-50.0, 0.0, 60.0},36 {-50.0, -60.0, 20.0},{-50.0, -60.0, 60.0},{-50.0, 0.0, 60.0},{-50.0, 0.0, 20.0},37 {50.0, -60.0, 0.0},{50.0, -60.0, 60.0},{50.0, 0.0, 60.0},{50.0, 0.0, 0.0},38 {50.0, -60.0, 60.0},{50.0, -60.0, 20.0},{50.0, 0.0, 20.0},{50.0, 0.0, 60.0},39 {-50.0, -60.0, 60.0},{50.0, -60.0, 60.0},{50.0, -60.0, 0.0},{-50.0, -60.0, 0.0}40 };*/41 42 24 using namespace std; 43 25 … … 50 32 if (root != NULL) 51 33 this->loadParams(root); 52 34 53 35 this->activate(); 54 36 } … … 59 41 this->deactivate(); 60 42 } 61 62 43 63 44 void VolFogEffect::loadParams(const TiXmlElement* root) … … 79 60 PRINTF(0)("Initalize VolFogEffect\n"); 80 61 }; 81 82 62 83 63 … … 111 91 void VolFogEffect::draw() const 112 92 { 93 // PRINTF(0)("DRAW VolFogEffect\n"); 113 94 114 /*int v; // store of next vertex ref 115 int ref; 95 glDepthMask(GL_TRUE); 96 glEnable(GL_BLEND); 97 glBlendFunc(GL_ONE_MINUS_SRC_ALPHA, GL_SRC_ALPHA); 98 // glDisable(GL_TEXTURE_2D); 99 // draw the fog panels 100 101 glBegin(GL_QUADS); 116 102 117 PRINTF(0)("DRAW VolFogEffect\n"); 103 glColor4f(0.6, 0.2, 0.0, (10.0 - (0.0 - -10.0f)) / (10.0 - 0.0)); 104 glVertex3f( 10.0f,-10.0f, 10.0f); // Top Right Of The Quad (Bottom) 105 glColor4f(0.6, 0.2, 0.0, (10.0 - (0.0 - -10.0f)) / (10.0 - 0.0)); 106 glVertex3f(-10.0f,-10.0f, 10.0f); // Top Left Of The Quad (Bottom) 107 glColor4f(0.6, 0.2, 0.0, (10.0 - (0.0 - -10.0f)) / (10.0 - 0.0)); 108 glVertex3f(-10.0f,-10.0f,-10.0f); // Bottom Left Of The Quad (Bottom) 109 glColor4f(0.6, 0.2, 0.0, (10.0 - (0.0 - -10.0f)) / (10.0 - 0.0)); 110 glVertex3f( 10.0f,-10.0f,-10.0f); // Bottom Right Of The Quad (Bottom) 111 112 glColor4f(0.6, 0.2, 0.0, (10.0 - (0.0 - 10.0f)) / (10.0 - 0.0)); 113 glVertex3f( 10.0f, 10.0f, 10.0f); // Top Right Of The Quad (Front) 114 glColor4f(0.6, 0.2, 0.0, (10.0 - (0.0 - 10.0f)) / (10.0 - 0.0)); 115 glVertex3f(-10.0f, 10.0f, 10.0f); // Top Left Of The Quad (Front) 116 glColor4f(0.6, 0.2, 0.0, (10.0 - (0.0 - -10.0f)) / (10.0 - 0.0)); 117 glVertex3f(-10.0f,-10.0f, 10.0f); // Bottom Left Of The Quad (Front) 118 glColor4f(0.6, 0.2, 0.0, (10.0 - (0.0 - -10.0f)) / (10.0 - 0.0)); 119 glVertex3f( 10.0f,-10.0f, 10.0f); // Bottom Right Of The Quad (Front) 120 121 glColor4f(0.6, 0.2, 0.0, (10.0 - (0.0 - -10.0f)) / (10.0 - 0.0)); 122 glVertex3f( 10.0f,-10.0f,-10.0f); // Top Right Of The Quad (Back) 123 glColor4f(0.6, 0.2, 0.0, (10.0 - (0.0 - -10.0f)) / (10.0 - 0.0)); 124 glVertex3f(-10.0f,-10.0f,-10.0f); // Top Left Of The Quad (Back) 125 glColor4f(0.6, 0.2, 0.0, (10.0 - (0.0 - 10.0f)) / (10.0 - 0.0)); 126 glVertex3f(-10.0f, 10.0f,-10.0f); // Bottom Left Of The Quad (Back) 127 glColor4f(0.6, 0.2, 0.0, (10.0 - (0.0 - 10.0f)) / (10.0 - 0.0)); 128 glVertex3f( 10.0f, 10.0f,-10.0f); // Bottom Right Of The Quad (Back) 129 130 glColor4f(0.6, 0.2, 0.0, (10.0 - (0.0 - 10.0f)) / (10.0 - 0.0)); 131 glVertex3f(-10.0f, 10.0f, 10.0f); // Top Right Of The Quad (Left) 132 glColor4f(0.6, 0.2, 0.0, (10.0 - (0.0 - 10.0f)) / (10.0 - 0.0)); 133 glVertex3f(-10.0f, 10.0f,-10.0f); // Top Left Of The Quad (Left) 134 glColor4f(0.6, 0.2, 0.0, (10.0 - (0.0 - -10.0f)) / (10.0 - 0.0)); 135 glVertex3f(-10.0f,-10.0f,-10.0f); // Bottom Left Of The Quad (Left) 136 glColor4f(0.6, 0.2, 0.0, (10.0 - (0.0 - -10.0f)) / (10.0 - 0.0)); 137 glVertex3f(-10.0f,-10.0f, 10.0f); // Bottom Right Of The Quad (Left) 138 139 glColor4f(0.6, 0.2, 0.0, (10.0 - (0.0 - 10.0f)) / (10.0 - 0.0)); 140 glVertex3f( 10.0f, 10.0f,-10.0f); // Top Right Of The Quad (Right) 141 glColor4f(0.6, 0.2, 0.0, (10.0 - (0.0 - 10.0f)) / (10.0 - 0.0)); 142 glVertex3f( 10.0f, 10.0f, 10.0f); // Top Left Of The Quad (Right) 143 glColor4f(0.6, 0.2, 0.0, (10.0 - (0.0 - -10.0f)) / (10.0 - 0.0)); 144 glVertex3f( 10.0f,-10.0f, 10.0f); // Bottom Left Of The Quad (Right) 145 glColor4f(0.6, 0.2, 0.0, (10.0 - (0.0 - -10.0f)) / (10.0 - 0.0)); 146 glVertex3f( 10.0f,-10.0f,-10.0f); // Bottom Right Of The Quad (Right) 118 147 119 for (ref=0; ref<NUM_PANELS; ref++) {148 glEnd(); 120 149 121 // disable writes to z buffer (if fog area) 122 glDepthMask(GL_FALSE); 123 124 // restore z buffer writes, set blend params & disable texturing 150 // restore rendering state 125 151 126 glDepthMask(GL_TRUE); 127 glEnable(GL_BLEND); 128 glBlendFunc(GL_ONE_MINUS_SRC_ALPHA, GL_SRC_ALPHA); 129 glDisable(GL_TEXTURE_2D); 152 // glEnable(GL_TEXTURE_2D); 153 glDisable(GL_BLEND); 130 154 131 // draw the fog panel132 133 v = ref * 4;134 glBegin(GL_QUADS);135 //this->setFogColor(v);136 glVertex3f(vertices[v].x, vertices[v].y, vertices[v].z); v++;137 //this->setFogColor(v);138 glVertex3f(vertices[v].x, vertices[v].y, vertices[v].z); v++;139 //this->setFogColor(v);140 glVertex3f(vertices[v].x, vertices[v].y, vertices[v].z); v++;141 //this->setFogColor(v);142 glVertex3f(vertices[v].x, vertices[v].y, vertices[v].z);143 glEnd();144 145 // restore rendering state146 147 glEnable(GL_TEXTURE_2D);148 glDisable(GL_BLEND);149 }*/150 155 } 151 156
Note: See TracChangeset
for help on using the changeset viewer.