Changeset 10083 in orxonox.OLD for branches/playability
- Timestamp:
- Dec 17, 2006, 2:24:09 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/playability/src/world_entities/effects/trail.cc
r10081 r10083 163 163 Vector now, later; 164 164 float fact = 1.0/this->sections; 165 float rad 0, rad1;165 float radzero, radone; 166 166 167 167 //glPushAttrib(GL_ENABLE_BIT); … … 231 231 for( int i = 1; i < this->sections-1; i++) 232 232 { 233 rad 1= this->radius * (1.0-i*fact);234 rad 0= this->radius * (1.0-(i+1)*fact);233 radone = this->radius * (1.0-i*fact); 234 radzero = this->radius * (1.0-(i+1)*fact); 235 235 236 236 now = this->nodeList[i]; … … 242 242 243 243 // horizontal polygon 244 Q[0] = now + Vector(0,rad 1,0) ;245 Q[3] = now + Vector(0,-rad 1,0) ;244 Q[0] = now + Vector(0,radone,0) ; 245 Q[3] = now + Vector(0,-radone,0) ; 246 246 247 247 glTexCoord2f(0.0f, 0.0f); glVertex3f(Q[0].x,Q[0].y,Q[0].z); … … 251 251 { 252 252 253 Q[1] = later + Vector(0,rad 0,0) ;254 Q[2] = later + Vector(0,-rad 0,0) ;253 Q[1] = later + Vector(0,radzero,0) ; 254 Q[2] = later + Vector(0,-radzero,0) ; 255 255 glTexCoord2f(0.0f, 1.0f); glVertex3f(Q[1].x,Q[1].y,Q[1].z); 256 256 glTexCoord2f(1.0f, 1.0f); glVertex3f(Q[2].x,Q[2].y,Q[2].z); … … 263 263 for( int i = this->sections-1; i > 0; i--) 264 264 { 265 rad 1= this->radius * (1.0-i*fact);266 rad 0= this->radius * (1.0-(i-1)*fact);265 radone = this->radius * (1.0-i*fact); 266 radzero = this->radius * (1.0-(i-1)*fact); 267 267 268 268 now = this->nodeList[i]; … … 274 274 275 275 // horizontal polygon 276 Q[0] = now + Vector(0,rad 1,0) ;277 Q[3] = now + Vector(0,-rad 1,0) ;276 Q[0] = now + Vector(0,radone,0) ; 277 Q[3] = now + Vector(0,-radone,0) ; 278 278 279 279 glTexCoord2f(1.0f, 0.0f); glVertex3f(Q[3].x,Q[3].y,Q[3].z); … … 282 282 if( i == 1) 283 283 { 284 Q[1] = later + Vector(0,rad 0,0) ;285 Q[2] = later + Vector(0,-rad 0,0) ;284 Q[1] = later + Vector(0,radzero,0) ; 285 Q[2] = later + Vector(0,-radzero,0) ; 286 286 glTexCoord2f(1.0f, 1.0f); glVertex3f(Q[2].x,Q[2].y,Q[2].z); 287 287 glTexCoord2f(0.0f, 1.0f); glVertex3f(Q[1].x,Q[1].y,Q[1].z); … … 295 295 for( int i = 1; i < this->sections-1; i++) 296 296 { 297 rad 1= this->radius * (1.0-i*fact);298 rad 0= this->radius * (1.0-(i+1)*fact);297 radone = this->radius * (1.0-i*fact); 298 radzero = this->radius * (1.0-(i+1)*fact); 299 299 300 300 now = this->nodeList[i]; … … 306 306 307 307 // horizontal polygon 308 Q[0] = now + targ.cross(Vector(0,rad 1,0)) ;309 Q[3] = now + targ.cross(Vector(0,-rad 1,0)) ;308 Q[0] = now + targ.cross(Vector(0,radone,0)) ; 309 Q[3] = now + targ.cross(Vector(0,-radone,0)) ; 310 310 311 311 glTexCoord2f(0.0f, 0.0f); glVertex3f(Q[0].x,Q[0].y,Q[0].z); … … 314 314 if( i == this->sections-1) 315 315 { 316 Q[1] = later + targ.cross(Vector(0,rad 0,0)) ;317 Q[2] = later + targ.cross(Vector(0,-rad 0,0)) ;316 Q[1] = later + targ.cross(Vector(0,radzero,0)) ; 317 Q[2] = later + targ.cross(Vector(0,-radzero,0)) ; 318 318 glTexCoord2f(0.0f, 1.0f); glVertex3f(Q[1].x,Q[1].y,Q[1].z); 319 319 glTexCoord2f(1.0f, 1.0f); glVertex3f(Q[2].x,Q[2].y,Q[2].z); … … 326 326 for( int i = this->sections-1; i > 0; i--) 327 327 { 328 rad 1= this->radius * (1.0-i*fact);329 rad 0= this->radius * (1.0-(i-1)*fact);328 radone = this->radius * (1.0-i*fact); 329 radzero = this->radius * (1.0-(i-1)*fact); 330 330 331 331 now = this->nodeList[i]; … … 337 337 338 338 // horizontal polygon 339 Q[0] = now + targ.cross(Vector(0,rad 1,0)) ;340 Q[3] = now + targ.cross(Vector(0,-rad 1,0)) ;339 Q[0] = now + targ.cross(Vector(0,radone,0)) ; 340 Q[3] = now + targ.cross(Vector(0,-radone,0)) ; 341 341 342 342 glTexCoord2f(0.0f, 0.0f); glVertex3f(Q[0].x,Q[0].y,Q[0].z); … … 345 345 if( i == 1) 346 346 { 347 Q[1] = later + targ.cross(Vector(0,rad 0,0)) ;348 Q[2] = later + targ.cross(Vector(0,-rad 0,0)) ;347 Q[1] = later + targ.cross(Vector(0,radzero,0)) ; 348 Q[2] = later + targ.cross(Vector(0,-radzero,0)) ; 349 349 glTexCoord2f(0.0f, 1.0f); glVertex3f(Q[1].x,Q[1].y,Q[1].z); 350 350 glTexCoord2f(1.0f, 1.0f); glVertex3f(Q[2].x,Q[2].y,Q[2].z);
Note: See TracChangeset
for help on using the changeset viewer.