robert.walters Posted February 16, 2022 Posted February 16, 2022 (edited) I have no trouble creating a head's up display by attaching a plane to the default view but when I try to attach planes to entities I can't seem to ever see the symbols. //In AppSystemLogic.h IG::ISymbolsController* myController; IG::ISymbolCircle *hoop; IG::ISymbolsPlane *plane; IG::ISymbolText *alt_baro_text; //In AppSystemLogic.cpp IG::ISymbolsController *myController = ig_manager->getSymbolsController(); myController->clear(); IG::ISymbolsPlane *plane = myController->createPlane(0, ig_manager->getView(0)); //this one works fine plane->setScreenSize(1920.0f, 1080.0f, 64.0f, 59.5f); RenderState *render_state = RenderState::get(); int halfHeight = render_state->getHeight() / 2; int halfWidth = render_state->getWidth() / 2; plane->setUVSize(-halfWidth, -halfHeight, halfWidth, halfHeight); //set plane properties float near = ig_manager->getView(0)->getNear(); float far = ig_manager->getView(0)->getFar(); float top = ig_manager->getView(0)->getTopDeg(); float aspectRatio = float(halfWidth) / float(halfHeight); //add text symbol to screen, this displays fine alt_baro_text = dynamic_cast<IG::ISymbolText *>(myController->createSymbol(IG::ISymbolsController::SYMBOL_TYPE::TEXT, 0)); plane->addSymbol(alt_baro_text); // add symbol to plane //This one doesn't work ig_manager->getSymbolsController()->createPlane(1, ig_manager->getEntity(0));//never see the result, I have also tried other entities with no luck ig_manager->getSymbolsController()->getPlane(1)->setScreenSize(1920.0f, 1080.0f, 64.0f, 59.5f); ig_manager->getSymbolsController()->getPlane(1)->setUVSize(-halfWidth, -halfHeight, halfWidth, halfHeight); ig_manager->getSymbolsController()->getPlane(1)->setPhysicalSize(7, 7); ig_manager->getSymbolsController()->getPlane(1)->setBillboard(1, 1); IG::ISymbolCircle *hoop = dynamic_cast<IG::ISymbolCircle *>(ig_manager->getSymbolsController()->createSymbol(IG::ISymbolsController::SYMBOL_TYPE::CIRCLE, 322)); ig_manager->getSymbolsController()->getPlane(1)->addSymbol(hoop); //setting position does not seem to make any difference, still can't see it ig_manager->getSymbolsController()->getPlane(1)->setPosition(vec3(16.383f, -1.0f, 1.0f)); hoop->setCenter(0.0f, 0.0f); hoop->setRadius(3.0f); hoop->setInnerRadius(1.0f); hoop->setFill(1); hoop->setColor(brightRed); //if I add hoop to plane 0 it appears as expected Edited February 16, 2022 by robert.walters spelling
cash-metall Posted February 17, 2022 Posted February 17, 2022 Hi! i just resized the circle hoop->setRadius(300); hoop->setInnerRadius(100); size 3 is very small, because halfWidth and halfHeight are very large (413 * 806 for me)
Recommended Posts