其他分享
首页 > 其他分享> > vs2017+pangolin的配置教程

vs2017+pangolin的配置教程

作者:互联网

Pangolin的简单使用

一、Pangolin的编译

二、Pangolin的配置

pangolin.lib
glew.lib
glu32.lib
opengl32.lib
mfplat.lib
mfreadwrite.lib
mfuuid.lib
strmiids.lib
mf.lib

三、测试例子

#include <iostream>
#include <iomanip>
#include <pangolin/pangolin.h>

using namespace std;

int main ( int argc, char** argv )
{
	pangolin::CreateWindowAndBind("my-slam: Map Viewer", 1024, 768);

	// 3D Mouse handler requires depth testing to be enabled
	glEnable(GL_DEPTH_TEST);

	// Issue specific OpenGl we might need
	glEnable(GL_BLEND);
	glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

	pangolin::CreatePanel("menu").SetBounds(0.0, 1.0, 0.0, pangolin::Attach::Pix(175));
	pangolin::Var<bool> menuFollowCamera("menu.Follow Camera", true, true);
	pangolin::Var<bool> menuShowPoints("menu.Show Points", true, true);
	pangolin::Var<bool> menuShowKeyFrames("menu.Show KeyFrames", true, true);
	pangolin::Var<bool> menuShowGraph("menu.Show Graph", true, true);
	pangolin::Var<bool> menuLocalizationMode("menu.Localization Mode", false, true);
	pangolin::Var<bool> menuReset("menu.Reset", false, false);

	// Define Camera Render Object (for view / scene browsing)
	pangolin::OpenGlRenderState s_cam = pangolin::OpenGlRenderState(
		pangolin::ProjectionMatrix(1024, 768, 500, 500, 512, 389, 0.1, 1000),
		pangolin::ModelViewLookAt(0, -0.7, -1.8, 0, 0, 0, 0.0, -1.0, 0.0)
	);

	pangolin::OpenGlMatrix Tcw;

	Tcw.SetIdentity();

	// Add named OpenGL viewport to window and provide 3D Handler
	pangolin::View& d_cam = pangolin::CreateDisplay()
		.SetBounds(0.0, 1.0, pangolin::Attach::Pix(175), 1.0, -1024.0f / 768.0f)
		.SetHandler(new pangolin::Handler3D(s_cam));

	while (1)
	{
		glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
		s_cam.Follow(Tcw);

		d_cam.Activate(s_cam);
		glClearColor(1.0f, 1.0f, 1.0f, 1.0f);

		pangolin::FinishFrame();
	}

	return 0;
}

标签:教程,1.0,lib,pangolin,vs2017,Pangolin,menu,true
来源: https://blog.csdn.net/qq_38589460/article/details/117934776