Precondition
- OSG library has been built in x32 or x64
- OSG Example data has been downloaded.
- assuming OSGPATH is setting as D:\OSG
- include - D:\OSG\include
- lib - D:\OSG\lib
- bin - D:\OSG\bin
- data - D:\OSG\data
- System environment has been set corroctly
- PATH - add D:\OSG\bin to PATH
- OSG_FILE_PATH - create this key with value D:\OSG\data
Overview
Normally you can find many instructions to say “Hello World” in OSG style.
It should look like following steps:
- Create a empty win32 console application.
- Add OSG lib to project properties.
- Add codes to show a 3D model.
- Compile and run application.
Create Project
Create an empty win32 console appliction project.
Create new project
file -> new -> project…
select -> Win32 -> Win32 Console Application -> OK
Application Settings -> check Empty project -> Finish
Configure Project Properties
project -> Properties -> VC++ Directories
Executable Directories - add D:\OSG\bin
Include Directories - add D:\OSG\include
Library Directories - add D:\OSG\lib
Notice
pay more attention to using same x64 or x86 Platform configuration!
Add Codes
Normally codes will be like this:
Compile and Run
A 3D model should be displayed on the screen correctly.
OSG VS2015 Troubleshooting If building or running above project with problems, please check another tutorial. LEARN MORE
Leave a Comment