需要依赖动态库:coin3d.dll libxml2.dll soqt1d.dll
pro文件:
TEMPLATE=app CONFIG+=console QT+=coregui PRJ_ROOT=.. LIB_DIR=$$quote(E:/ProgramFiles(x86)/rl-0.6.2/lib) BIN=$$PRJ_ROOT/../../bin/ DESTDIR=$$BIN SRC_ROOT=$$PRJ_ROOT/src/ INCLUDEPATH+=$$quote(E:/ProgramFiles(x86)/rl-0.6.2/include) INCLUDEPATH+=$$quote(E:/ProgramFiles(x86)/rl-0.6.2/include/boost-1_52) DEFINES+=COIN_DLL DEFINES+=SOQT_DLL DEFINES+=M_PI=3.14159265358979323846 #解决Eigenabort的问题 #参考:http://eigen.tuxfamily.org/dox-devel/TopicUnalignedArrayAssert.html DEFINES+=EIGEN_DONT_ALIGN_STATICALLY CONFIG(debug,debug|release){ LIBS+=-L$$LIB_DIR/-lrlmdld-lrlkind-lrlsgd-lrlxmld-lcoin3d-lsoqt1d-llibxml2 }else{ LIBS+=-L$$LIB_DIR/-lrlmdl-lrlkin-lrlsg-lrlxml-lcoin3-llibxml2 } SOURCES+=$$SRC_ROOT/main.cpp
源文件:
#include<iostream> #include<QWidget> #include<Inventor/SoDB.h> #include<Inventor/Qt/SoQt.h> #include<Inventor/Qt/viewers/SoQtExaminerViewer.h> #include<rl/sg/so/Scene.h> int main(intargc,char**argv) { SoDB::init(); QWidget*widget=SoQt::init(argc,argv,argv[0]); widget->resize(800,600); rl::sg::so::Scenescene; scene.load("E:\\ProgramFiles(x86)\\rl-0.6.2\\share\\rl\\examples\\rlsg\\unimation-puma560_boxes.xml"); SoQtExaminerViewerviewer(widget,NULL,true,SoQtFullViewer::BUILD_POPUP); viewer.setSceneGraph(scene.root); viewer.setTransparencyType(SoGLRenderAction::SORTED_OBJECT_BLEND); viewer.show(); SoQt::show(widget); SoQt::mainLoop(); return0; }
时间: 2024-11-05 23:11:42