Category Archives: OSG

OSG Sample Applications (Intermediate)

Sound (Object Transformation Using Keyboard Input 에 OpenAL 사용하여 sound를 추가한 예) – osgd.lib osgViewerd.lib osgDBd.lib osgGAd.lib OpenThreadsd.lib osgUtild.lib OpenAL32.lib
1102344495.zip
Flipbook (여러개 object models을 loading한 후 flipbook animation을 만든 예 using Switch)
1326054822.zip
Flipbook (여러개 object models을 loading한 후 flipbook animation을 만든 예 using Sequence)
1049312438.zip
Dynamic Object Placement (object model을 loading한 후 dynamic 하게 object population 하는 예) – osgd.lib osgViewerd.lib osgDBd.lib osgGAd.lib
OSG Sample Applications (Beginner)에서 object_model_data.zip 을 사용할 것.
1331381724.zip
Catmull Rom PathFollower (object model을 지정한 콘트롤 포인트를 지나가는 catmull rom path follower 예) – osgDBd.lib osgd.lib OpenThreadsd.lib osgGAd.lib osgUtild.lib osgViewerd.lib
1141611334.zip
Intersect (Object Population on a Terrain) – osgDBd.lib osgd.lib OpenThreadsd.lib osgGAd.lib osgUtild.lib osgViewerd.lib
OSG Sample Applications (Beginner)에서 object_model_data.zip 을 사용할 것.

1231392133.cpp
Intersect (Moving a Truck Object Model on a Terrain) – osgDBd.lib osgd.lib OpenThreadsd.lib osgGAd.lib osgUtild.lib osgViewerd.lib
1161137858.zip
Particle System

HUD & osgText (Creating Heap-Up Display style text) – osgd.lib osgViewerd.lib osgTextd.lib
1143898413.zip

OSG Sample Applications (Beginner)

All built and tested with Visual Studio .NET2005 Win32 Console Application (without precompile header file)

Geometry (Draw a Color Square using osg::Geometry & osg::Geode) – osgd.lib osgViewerd.lib
1260404131.cpp
Texture Geometry (Draw a Textured Square using osg::Texture2D & osg::Image & osgDB::readImageFile(filename)) – osgd.lib osgViewerd.lib osgDBd.lib
1034721829.cpp
Shapes (Draw Shapes, such as Box, Sphere, Cone, Cylinder, Capsule using osg::ShapeDrawable) – osgd.lib osgViewerd.lib
1109797805.cpp
Materials (Material Properties for three shape objects using osg::Material) – osgd.lib osgViewerd.lib
1310761035.cpp
Light (Directional Light) – osgd.lib osgViewerd.lib
1086880964.cpp
Light (Positional Light) – osgd.lib osgViewerd.lib
1126632461.cpp
Light (Spot Light) – osgd.lib osgViewerd.lib

Light (Moving Light using osg::Node::setUpdateCallback(…) & MyUpdateCallback) – osgd.lib osgViewerd.lib
1368627098.cpp
Load a Model (Load an Object Model using osg::readNodeFile(filename)) – osgd.lib osgViewerd.lib osgDBd.lib
1009571790.cpp
Object Transformation (Transform Shape Objects using osg::TransformMatrix & osg::PositionAttitudeTransform) – osgd.lib osgViewerd.lib
1010448391.cpp
Object Transformation (Transform Object Models using osg::PositionAttitudeTransform) – osgd.lib osgViewerd.lib osgDBd.lib
1083419069.zip
Object Transformation (Orbiting an Object using osg::Node::setUpdateCallback(…) & osg::NodeCallback) – osgd.lib osgViewerd.lib osgDBd.lib
1050766644.cpp
Object Transformation (Rotating an Object using osg::Node::setUpdateCallback(…) & osg::AnimationPathCallback) – osgd.lib osgViewerd.lib osgDBd.lib
1268505567.cpp
Object Transformation Using Keyboard Input (Rotating Objects triggered by Space-key using KeyboardHandler) – osgd.lib osgViewerd.lib osgDBd.lib osgGAd.lib
1260374002.cpp
Billboards (Objects always facing the camera using osg::Billboard) – osgd.lib osgViewerd.lib osgDBd.lib
1130686974.cpp
LOD (Object Level of Detail using osg::LOD) – osgd.lib osgViewerd.lib osgDBd.lib
This example needs object_model_data.zip, which used in the Object Transformation example
1002965270.cpp
Switch (Switch on one of the three child object models triggered by Space-key written using osg::Switch & Keyboard Input)
1326100890.cpp
Write a Scene (Write a Scene Graph of drawing a square to hard disk using osg::writeNodeFile(filename)) – osgd.lib osgViewerd.lib osgDBd.lib
-To see what this scene graph looks like, use “osgviewer Simple.osg”
1018196408.cpp

3D models

3D Cafe
http://www.3dcafe.com/index.php?option=com_content&task=view&id=14&Itemid=80

CadPlants
http://www.cadplants.com/

3D XTRAS
http://www.3dxtras.com/3dxtras-free-3d-models-list.asp

Plants 3D models from 3DXTRAS
http://www.3dxtras.com/3dxtras-free-3d-models-details.asp?prodid=2135
http://www.3dxtras.com/3dxtras-free-3d-models-details.asp?prodid=10212
http://www.3dxtras.com/3dxtras-free-3d-models-details.asp?prodid=7689
http://www.3dxtras.com/3dxtras-free-3d-models-details.asp?prodid=9666
http://www.3dxtras.com/3dxtras-free-3d-models-details.asp?prodid=10198

OSG Applications Compile and Execute


  • Use Visual Studio 2005 (install service pack 1)

    • Add New Project for “Win32 Console Application”
    • Click next on application wizard, and then check “empty project” in additional options

  • Add the following path to the Additional Include Directories (Project Properties -> Configuration Properties -> C/C++ ->General -> Additional Include Directories)

    • $(OSG_ROOT)\include

  • Similarly, set the linker directory to the following

    • $(OSG_ROOT)\lib

  • And add the libraries to the input option of the linker setting

    • Release Mode: osgViewer.lib osgDB.lib osgUtil.lib osg.lib OpenThreads.lib opengl32.lib glu32.lib
    • Debug Mode: osgViewerd.lib osgDBd.lib osgUtild.lib osgd.lib OpenThreadsd.lib opengl32.lib glu32.lib

  • Finally, run your OSG application

OSG Getting Stated


  1. Download OSG-2.5.2.zip from ftp://dis.dankook.ac.kr/OSG/OSG-2.5.2.zip
  2. Unzip it at C drive
  3. Set environment variables

    • Go to Control panel -> System icon -> Advanced tab -> Environment variables
    • Add “C:\OSG-2.5.2\bin;C:\OSG-2.5.2\bin\osgplugins-2.5.2;C:\OSG-2.5.2\3rdParty\bin” for System’s “Path” variable
    • Create a new variable called “OSG_FILE_PATH” and set the value “C:\OSG-2.5.2\OpenSceneGraph-Data” for the variable
    • Create a new variable called “OSG_NOTIFY_LEVEL” and set the value “DEBUG_INFO” for the debug notification
    • Create a new variable called “OSG_SCREEN” and set the value “0” to use only one main display monitor
    • Create a new variable called “OSG_ROOT” and the set the value “C:\OSG-2.4.0” for Visual Studio .Net 2005

  4. Open a command window and run “osgviewer cow.osg”