环境: ubuntu 12.04 编译 osg


1: 安装必备依赖库: sudo apt-get build-dep openscenegraph
2:安装OpenGL库: sudo apt-get install mesa-common-dev freeglut3 freeglut3-dev
3: 下载源码最新的release 版本: http://www.openscenegraph.org/index.php/download-section/stable-releases  
4:解压后进入目录,依次运行:
    ./configure (如果提示须 sudo make install_ld_conf, 则运行这个命令)
    make
    sudo make install
    ldconfig

5: 运行检查是否安装好, osgversion。



如果运行samples, 请参考这个 

 

Running the examples

 The OpenSceneGraph has an ever growing number of examples available for developers to learn from. Following is a guide to getting these examples running.

Once the OpenSceneGraph is installed you will need to place the location where it was installed on the system paths environmental variables. Also download the demo data and set the OSG_FILE_PATH environment variable so that the example datasets can be found by OSG. It is probably worth setting your autoexec.bat, .bashrc, .tcsh, etc to pick up on these settings so that next time you log in everything is in easy reach. Below are examples for the different platforms on how to set up your environment. The examples are not built by default, use the cmake utility and set the option to enable building of the example applications. To build them, run cmake with the following parameter: -DBUILD_OSG_EXAMPLES=1

  • Windows:
    set PATH=path;C:\OpenSceneGraph\bin
    set OSG_FILE_PATH=C:\OpenSceneGraph-Data;C:\OpenSceneGraph-Data\Images
    
  • Unix - bashrc:
    export PATH = ${PATH}:/home/myaccount/OpenSceneGraph/bin
    export LD_LIBRARY_PATH = ${LD_LIBRARY_PATH}:/home/myaccount/OpenSceneGraph/lib
    export OSG_FILE_PATH = /home/myaccount/OpenSceneGraph-Data:/home/myaccount/OpenSceneGraph-Data/Images
    
  • Unix - tcsh:
    setenv PATH ${PATH}:/home/myaccount/OpenSceneGraph/bin
    setenv LD_LIBRARY_PATH = ${LD_LIBRARY_PATH}:/home/myaccount/OpenSceneGraph/lib
    setenv OSG_FILE_PATH /home/myaccount/OpenSceneGraph-Data:/home/myaccount/OpenSceneGraph-Data/Images
    
  • MacOSX:
    setenv PATH "${PATH}:${OSGHOME}/lib:${OSGHOME}/lib/osgPlugins"
    setenv DYLD_LIBRARY_PATH "${OSGHOME}/lib:${OSGHOME}/lib/osgPlugins"
    setenv DYLD_BIND_AT_LAUNCH 
    setenv OSG_FILE_PATH "/home/myaccount/OpenSceneGraph-Data:/home/myaccount/OpenSceneGraph-Data/Images"
    

All the examples run from the command-line. Most require parameters to be passed, such as what file to load. If you are in any doubt just run the application and it will either run, or provide help on what options it accepts. You can also print out full help my running the example with the option --help.

To run the examples in quick succession on Windows, use the runexamples.bat script which can be found in the the root of the OpenSceneGraph distribution:

./runexamples.bat

Press Escape to close each application and move on to the next application. On Unix, you should be able to use

sh ./runexamples.bat



 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值