/**
 * Render ObjComponent
 * @param ObjComp :: input to render
 */
void GluGeometryRenderer::Render(IObjComponent *ObjComp) const {
  glPushMatrix();
  V3D pos = ObjComp->getPos();
  Quat rot = ObjComp->getRotation();
  double rotGL[16];
  rot.GLMatrix(&rotGL[0]);
  glTranslated(pos[0], pos[1], pos[2]);
  glMultMatrixd(rotGL);
  ObjComp->drawObject();
  glPopMatrix();
}
Пример #2
0
void CacheGeometryRenderer::Initialize(IObjComponent *ObjComp) {
  glPushMatrix();
  V3D pos = ObjComp->getPos();
  Quat rot = ObjComp->getRotation();
  double rotGL[16];
  rot.GLMatrix(&rotGL[0]);
  glTranslated(pos[0], pos[1], pos[2]);
  glMultMatrixd(rotGL);
  V3D scaleFactor = ObjComp->getScaleFactor();
  glScaled(scaleFactor[0], scaleFactor[1], scaleFactor[2]);
  ObjComp->drawObject();
  glPopMatrix();
}