void myDisplay(void)
{
   glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);  // z-buffering
   glColor3f (1.0, 1.0, 1.0);

   drawFrontView();
   drawTopView();
   drawRightSideView();
   drawOffAxesView();
}
Ejemplo n.º 2
0
void viewprt::drawViewPorts(float scale2, float scale3, float scale4, float scalepers)
{
     // Left top view
    video::IVideoDriver* driver = device->getVideoDriver();
    scene::ISceneManager* smgr = device->getSceneManager();
    IGUIEnvironment* env = device->getGUIEnvironment();

         s32 screenx = driver->getScreenSize().Width;
         s32 screeny = driver->getScreenSize().Height;
         screenx-=viewrightspace;
         bool skyb = SkyBox->isVisible();


         // Right top view - perspective
         driver->beginScene(true, true, video::SColor(150,50,50,50));
         if (skyb) SkyBox->setVisible(true); else SkyBox->setVisible(false); // show the skybox

         drawPerspectiveView();
         driver->setViewPort(core::rect<s32>((screenx/2),50,screenx,(screeny/2)-5));
         smgr->drawAll();
          // hide the skybox not working for ortho viewports
         drawTopView();
         driver->setViewPort(core::rect<s32>(0,50,screenx/2,(screeny/2)-5));
         smgr->drawAll();

         drawSideView();
         driver->setViewPort(core::rect<s32>(0,(screeny/2),screenx/2,screeny));
         smgr->drawAll();

         drawFrontView();
         driver->setViewPort(core::rect<s32>((screenx/2),(screeny/2)+2,screenx,screeny));
         smgr->drawAll();

         // restore the view for GUI drawing
         driver->setViewPort(core::rect<s32>(0,0,driver->getScreenSize().Width,screeny));
         bill->setVisible(false);
         // draw the viewport boundary
         smgr->setActiveCamera(Camera[0]);
         driver->draw2DRectangle(video::SColor(255,20,20,20),
				core::rect<s32>(0, screeny/2-5, screenx, screeny/2-1));
         driver->draw2DRectangle(video::SColor(255,20,20,20),
				core::rect<s32>(screenx/2-2, 50, screenx/2+2, screeny));
		 if (skyb) SkyBox->setVisible(true); else SkyBox->setVisible(false); // redisplay the viewport

		 env->drawAll();
		 driver->endScene();
}
Ejemplo n.º 3
0
void viewprt::drawSingle(int view)
{
     video::IVideoDriver* driver = device->getVideoDriver();
     scene::ISceneManager* smgr = device->getSceneManager();
     IGUIEnvironment* env = device->getGUIEnvironment();
     s32 screenx = driver->getScreenSize().Width;
     s32 screeny = driver->getScreenSize().Height;
     driver->beginScene(true, true, video::SColor(150,50,50,50));

     switch (view)
     {case 0 : {drawPerspectiveView(); break;}
      case 2 : {drawTopView(); break;}
      case 3 : {drawFrontView(); break;}
      case 4 : {drawSideView(); break;}
     }
     driver->setViewPort(core::rect<s32>(0,50,screenx-viewrightspace,screeny));
     smgr->drawAll();
     driver->setViewPort(core::rect<s32>(0,0,driver->getScreenSize().Width,screeny));
     env->drawAll();
     driver->endScene();
}