当前位置:网站首页>OSG environment construction (win10+vs2019)
OSG environment construction (win10+vs2019)
2022-07-27 06:13:00 【122&&113】
preparation
Download related files , link :OSG relevant
Be careful , You need to download your own corresponding vs Version of file !!!

What I use here is vs2019x64 Of , Only the part framed by the red circle is downloaded .

After downloading, unzip it into a folder set by yourself , Note that the folder path should not contain Chinese !!!

Decompression needs attention :

Configure environment variables
Add the path to the user variable Path in .

Repeat the above , Add another two paths .

Create a new environment variable , Used to use the data referenced therein , To use your own data later, you can directly add your own file path to this variable .

Input OSGVIEWER GLIDER. OSG
Normally, images will appear , But I didn't show up here .
But I still directly carry out the following operations , And it does not affect the later program development .
The test program
Create a c++ Console project .
Set relevant parameters for the property page of the program .


Add additional dependencies :
osgd.lib
osgGAd.lib
osgDBd.lib
osgViewerd.lib
osgUtild.lib

Sample code :
#include <iostream>
#include <osgViewer/Viewer>
#include <osgDB/ReadFile>
int main()
{
osgViewer::Viewer viewer;
viewer.setSceneData(osgDB::readNodeFile("glider.osg"));
return viewer.run();
}
You need to pay attention to modifying the operation parameters :

Be careful , After the above operations ,VS2015 The previous one should be able to run directly ,VS2015 And later versions will report errors , Here, you need to manually add the preprocessor definition in the attribute .
Results after run , Mouse can slide :


边栏推荐
- UnityShader-LowPoly
- Unity 菜单界面的简单介绍
- 遥感影像识别-多类识别下的错分问题
- 力扣题解 动态规划(3)
- [Arduino] reborn Arduino monk (1)
- Pzk learns data types, binary conversion, input and output, operators, branch statements, ifelse of C language
- ROS节点名称重名
- 力扣题解 动态规划(6)
- [headline] Rebirth: the basis of CNN image classification
- C# Json编码在TCP通讯中的一些使用总结
猜你喜欢
随机推荐
Dynamic programming for solving problems (2)
Li Kou 236. the nearest common ancestor of binary tree
编程学习记录——第6课【函数】
[song] rebirth of me in py introductory training (8): module
Unity Hub登录无响应
IP核小结
遥感影像识别-成像合成
【动态规划----钢条切割问题】
力扣题解 动态规划(3)
[first song] rebirth of me in py introductory training (2): formula programming
Unity 窗口界面的简单介绍
UnityShader-高斯模糊
UnityShader-深度纹理(理解以及遇到的问题)
wireshark图形界面抓包
ROS运行管理之launch文件
Summary of the use of C # Jason code in TCP communication
编程学习记录——第7课【函数】
Weidongshan digital photo frame project learning (IV) simple TXT document display (e-paper book)
遥感影像识别进展2022/5/5
Unity 引擎开始从 Mono 迁移到 .NET CoreCLR








