Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4671 in orxonox.OLD for orxonox/trunk/src/lib/collision_detection


Ignore:
Timestamp:
Jun 23, 2005, 6:54:34 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: the blended boxes get rendered correctly

Location:
orxonox/trunk/src/lib/collision_detection
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/collision_detection/obb_tree.cc

    r4670 r4671  
    5151    transparentMaterial[i] = new Material();
    5252    transparentMaterial[i]->setIllum(3);
    53     transparentMaterial[i]->setTransparency(0.5);
     53    transparentMaterial[i]->setTransparency(0.2);
    5454  }
    5555  transparentMaterial[0]->setAmbient(0.0, 0.3, 0.0);
  • orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc

    r4670 r4671  
    761761    glEnd();
    762762
     763
     764    if( drawMode & DRAW_BV_BLENDED)
     765    {
     766      glBegin(GL_QUADS);
     767      glVertex3f(cen.x - axis[0].x * len[0] + axis[1].x * len[1] - axis[2].x * len[2],
     768                 cen.y - axis[0].y * len[0] + axis[1].y * len[1] - axis[2].y * len[2],
     769                 cen.z - axis[0].z * len[0] + axis[1].z * len[1] - axis[2].z * len[2]);
     770      glVertex3f(cen.x + axis[0].x * len[0] + axis[1].x * len[1] - axis[2].x * len[2],
     771                 cen.y + axis[0].y * len[0] + axis[1].y * len[1] - axis[2].y * len[2],
     772                 cen.z + axis[0].z * len[0] + axis[1].z * len[1] - axis[2].z * len[2]);
     773      glVertex3f(cen.x + axis[0].x * len[0] - axis[1].x * len[1] - axis[2].x * len[2],
     774                 cen.y + axis[0].y * len[0] - axis[1].y * len[1] - axis[2].y * len[2],
     775                 cen.z + axis[0].z * len[0] - axis[1].z * len[1] - axis[2].z * len[2]);
     776      glVertex3f(cen.x - axis[0].x * len[0] - axis[1].x * len[1] - axis[2].x * len[2],
     777                 cen.y - axis[0].y * len[0] - axis[1].y * len[1] - axis[2].y * len[2],
     778                 cen.z - axis[0].z * len[0] - axis[1].z * len[1] - axis[2].z * len[2]);
     779      glEnd();
     780
     781      glBegin(GL_QUADS);
     782      glVertex3f(cen.x - axis[0].x * len[0] + axis[1].x * len[1] + axis[2].x * len[2],
     783                 cen.y - axis[0].y * len[0] + axis[1].y * len[1] + axis[2].y * len[2],
     784                 cen.z - axis[0].z * len[0] + axis[1].z * len[1] + axis[2].z * len[2]);
     785      glVertex3f(cen.x + axis[0].x * len[0] + axis[1].x * len[1] + axis[2].x * len[2],
     786                 cen.y + axis[0].y * len[0] + axis[1].y * len[1] + axis[2].y * len[2],
     787                 cen.z + axis[0].z * len[0] + axis[1].z * len[1] + axis[2].z * len[2]);
     788      glVertex3f(cen.x + axis[0].x * len[0] - axis[1].x * len[1] + axis[2].x * len[2],
     789                 cen.y + axis[0].y * len[0] - axis[1].y * len[1] + axis[2].y * len[2],
     790                 cen.z + axis[0].z * len[0] - axis[1].z * len[1] + axis[2].z * len[2]);
     791      glVertex3f(cen.x - axis[0].x * len[0] - axis[1].x * len[1] + axis[2].x * len[2],
     792                 cen.y - axis[0].y * len[0] - axis[1].y * len[1] + axis[2].y * len[2],
     793                 cen.z - axis[0].z * len[0] - axis[1].z * len[1] + axis[2].z * len[2]);
     794      glEnd();
     795    }
     796
     797
    763798    if( drawMode & DRAW_BV_BLENDED)
    764799      this->obbTree->getMaterial(treeIndex)->select();
     
    771806    if( !(drawMode & DRAW_SINGLE && depth != 0))
    772807    {
     808      if( drawMode & DRAW_BV_BLENDED)
     809        this->obbTree->getTransparentMaterial(treeIndex)->select();
     810
    773811    /* now draw the separation plane */
    774812    Vector a1 = this->bvElement->axis[(this->longestAxisIndex + 1)%3];
     
    783821    glVertex3f(c.x + a1.x * l1 - a2.x * l2, c.y + a1.y * l1- a2.y * l2, c.z + a1.z * l1 - a2.z * l2);
    784822    glEnd();
     823
     824    if( drawMode & DRAW_BV_BLENDED)
     825      this->obbTree->getMaterial(treeIndex)->select();
     826
    785827    }
    786828  }
Note: See TracChangeset for help on using the changeset viewer.