2002-04-24 21:05:03 +08:00
|
|
|
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
2002-04-25 21:26:33 +08:00
|
|
|
<meta name="GENERATOR" content="Mozilla/4.77 [en] (X11; U; Linux 2.4.3-20mdk i686) [Netscape]">
|
2003-04-11 18:37:31 +08:00
|
|
|
<title>examples</title>
|
2002-04-24 21:05:03 +08:00
|
|
|
</head>
|
|
|
|
<body text="#000000" bgcolor="#FFFFFF" link="#0000FF" vlink="#990066" alink="#FF0000">
|
2003-04-24 21:44:30 +08:00
|
|
|
<img SRC="images/OpenSceneGraphBanner_Distribution.jpg">
|
2002-04-24 22:14:37 +08:00
|
|
|
<table>
|
2002-04-25 21:26:33 +08:00
|
|
|
<tr>
|
|
|
|
<td><a href="index.html">Index</a></td>
|
|
|
|
|
|
|
|
<td><a href="introduction.html">Introduction</a></td>
|
|
|
|
|
|
|
|
<td><a href="contents.html">Contents</a></td>
|
|
|
|
|
|
|
|
<td><a href="install.html">Install</a></td>
|
|
|
|
|
|
|
|
<td><a href="dependencies.html">Dependencies</a></td>
|
|
|
|
|
2003-04-11 18:37:31 +08:00
|
|
|
<td><a href="examples.html">examples</a></td>
|
2002-04-25 21:26:33 +08:00
|
|
|
|
|
|
|
<td><a href="data.html">Data</a></td>
|
|
|
|
|
2003-04-11 18:37:31 +08:00
|
|
|
<td><a href="osgviewer.html">Viewer</a></td>
|
2002-04-25 21:26:33 +08:00
|
|
|
|
|
|
|
<td><a href="stereo.html">Stereo</a></td>
|
|
|
|
|
|
|
|
<td><a href="plan.html">Plan</a></td>
|
|
|
|
|
|
|
|
<td><a href="documentation.html">Reference Guides</a></td>
|
|
|
|
</tr>
|
2002-04-24 22:14:37 +08:00
|
|
|
</table>
|
|
|
|
|
2002-04-24 21:05:03 +08:00
|
|
|
<h2>
|
2003-04-11 18:37:31 +08:00
|
|
|
<a NAME="Running the demos"></a><u>Running the examples</u></h2>
|
2002-04-25 21:26:33 +08:00
|
|
|
Once the OpenSceneGraph is <a href="install.html">installed</a> you will
|
|
|
|
need place the location where it was installed on the you systems paths
|
|
|
|
environmental variables, and then download the <a href="data.html">demo
|
|
|
|
data</a> and set the <b>OSG_FILE_PATH</b> so that the file loading can
|
|
|
|
locate the datasets. It is probably worth setting you autoexec.bat, .bashrc
|
|
|
|
or.tcsh etc to pick up on these settings so that next time you log in everything
|
|
|
|
is in easy reach.
|
|
|
|
<li>
|
|
|
|
Windows:</li>
|
|
|
|
|
|
|
|
<ul><b>set PATH = C:/all/the/exisitng/paths;C:/OpenSceneGraph/bin</b>
|
2003-05-26 05:06:23 +08:00
|
|
|
<br><b>set OSG_FILE_PATH = C:/OpenSceneGraph-Data;C:/OpenSceneGraph-Data/Images</b></ul>
|
2002-04-25 21:26:33 +08:00
|
|
|
|
|
|
|
<li>
|
|
|
|
Unix</li>
|
|
|
|
|
|
|
|
<ul><b>export PATH = ${PATH}:/home/myaccount/OpenSceneGraph/bin</b>
|
2002-04-25 15:29:02 +08:00
|
|
|
<br><b>export LD_LIBRARY_PATH = ${LD_LIBRARY_PATH}:/home/myaccount/OpenSceneGraph/lib</b>
|
2003-05-26 05:06:23 +08:00
|
|
|
<br><b>export OSG_FILE_PATH = /home/myaccount/OpenSceneGraph-Data:/home/myaccount/OpenSceneGraph-Data/Images</b>
|
2002-04-25 15:29:02 +08:00
|
|
|
<br>or
|
|
|
|
<br><b>setenv PATH ${PATH}:/home/myaccount/OpenSceneGraph/bin</b>
|
|
|
|
<br><b>setenv LD_LIBRARY_PATH = ${LD_LIBRARY_PATH}:/home/myaccount/OpenSceneGraph/lib</b>
|
2003-05-26 05:06:23 +08:00
|
|
|
<br><b>setenv OSG_FILE_PATH /home/myaccount/OpenSceneGraph-Data:/home/myaccount/OpenSceneGraph-Data/Images</b></ul>
|
2002-06-09 03:58:05 +08:00
|
|
|
|
|
|
|
<li>
|
|
|
|
MacOSX:</li>
|
|
|
|
|
|
|
|
<ul><b>setenv PATH "${PATH}:${OSGHOME}/lib:${OSGHOME}/lib/osgPlugins"</b>
|
|
|
|
<br><b>setenv DYLD_LIBRARY_PATH "${OSGHOME}/lib:${OSGHOME}/lib/osgPlugins"</b>
|
2003-05-26 05:06:23 +08:00
|
|
|
<br><b>setenv DYLD_BIND_AT_LAUNCH</b>
|
|
|
|
<br><b>setenv OSG_FILE_PATH "/home/myaccount/OpenSceneGraph-Data:/home/myaccount/OpenSceneGraph-Data/Images"</b></ul>
|
2002-06-09 03:58:05 +08:00
|
|
|
|
2002-04-25 21:26:33 +08:00
|
|
|
All the demos run on the commandline, most requiring parameters, 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.
|
|
|
|
<br>
|
|
|
|
<table>
|
|
|
|
<tr>
|
2003-04-11 18:37:31 +08:00
|
|
|
<td><a href="osgviewer.html"><img SRC="images/osgviewer_cow.jpg" BORDER=0 height=100 width=128></a></td>
|
2002-04-25 15:29:02 +08:00
|
|
|
|
2003-04-11 18:37:31 +08:00
|
|
|
<td><b>osgviewer cow.osg</b></td>
|
2002-04-24 21:05:03 +08:00
|
|
|
|
2003-04-11 18:37:31 +08:00
|
|
|
<td>The scene graph viewer demo uses osgProducer::Viewer to bring up a basic
|
|
|
|
viewer. To find out what command line arguments it takes simply run osgviewer
|
|
|
|
without any arguments. To load a model simple run osgviewer filename.ext. The
|
|
|
|
osgProducer::Viewer provides an extensive set of operations that can be used
|
2002-04-25 21:26:33 +08:00
|
|
|
to display information about the loaded database such as performance stats,
|
|
|
|
through to output a snapshot of the screen, which is how these thumbnails
|
|
|
|
were created. For a full list of key presses and mouse interaction read
|
2003-04-11 18:37:31 +08:00
|
|
|
the <a href="osgviewer.html">osgviewer</a> documentation.</td>
|
2002-04-25 21:26:33 +08:00
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2003-04-11 18:37:31 +08:00
|
|
|
<td><a href="stereo.html"><img SRC="images/osgviewer_stereo.jpg" BORDER=0 height=100 width=128></a></td>
|
2002-04-25 21:26:33 +08:00
|
|
|
|
2003-04-11 18:37:31 +08:00
|
|
|
<td><b>osgviewer --stereo cessna.osg</b></td>
|
2002-04-25 21:26:33 +08:00
|
|
|
|
|
|
|
<td>The scene graph viewer also supports anaglyphic, quad buffered, and
|
|
|
|
split screen stereo modes, for a full list of options and environmental
|
|
|
|
variables see the <a href="stereo.html">stereo</a> documentation.</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td><img SRC="images/hangglide.jpg" BORDER=0 height=100 width=128></td>
|
|
|
|
|
|
|
|
<td><b>hangglide</b></td>
|
|
|
|
|
|
|
|
<td>The hang glide demo creates a simple flying site (Don Burns local hang
|
|
|
|
glide site in fact!), demonstrating how to create simple terrain, trees
|
|
|
|
and skydomes, and how to implement a simple flight camera manipulator to
|
|
|
|
allow the user to fly around. </td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td><img SRC="images/osgbillboard.jpg" BORDER=0 height=100 width=128></td>
|
|
|
|
|
|
|
|
<td><b>osgbillboard lz.rgb</b></td>
|
|
|
|
|
|
|
|
<td>Demonstrates how to create the various types of billboard supported
|
|
|
|
by the OpenSceneGraph. Billboards are typically used for trees or particles
|
|
|
|
effects. </td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td><img SRC="images/osghud.jpg" BORDER=0 height=100 width=128></td>
|
|
|
|
|
|
|
|
<td><b>osghud glider.osg</b></td>
|
|
|
|
|
2003-04-11 18:37:31 +08:00
|
|
|
<td>Very similar to the basic osgviewer demo, but adds an orthographic projection
|
2002-04-25 21:26:33 +08:00
|
|
|
over the top of the main 3D view to create a head up display effect. Also
|
|
|
|
demonstrates how to use osgText. .</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td><img SRC="images/osgimpostor.jpg" BORDER=0 height=100 width=128></td>
|
|
|
|
|
|
|
|
<td><b>osgimpostor Town.osg</b></td>
|
|
|
|
|
|
|
|
<td>OpenSceneGraph is unique among scene graph in the fact that it supports
|
|
|
|
dynamically updated impostors natively, and this demo uses osgUtil::InsertImpostorVisitor
|
|
|
|
to traverse the loaded scene graph inserting osg::Importor nodes in place
|
|
|
|
of groups and LOD, so you can add Impostor into any of your own datasets!
|
|
|
|
The scene graph then takes over full responsibility for managing required
|
|
|
|
multistage rendering all dynamically at runtime, whilst keeping it neatly
|
|
|
|
encapsulated making it incredible easy to use. The Impostor support demonstrates
|
|
|
|
how powerful the multi-stage multi-pass rendering framework that the OpenSceneGraph
|
|
|
|
has, almost all other scene graphs have to hardwire such effects into them
|
|
|
|
and require significant application coding to do so. </td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td><img SRC="images/osgreflect.jpg" BORDER=0 height=100 width=128></td>
|
|
|
|
|
|
|
|
<td><b>osgreflect cow.osg</b></td>
|
|
|
|
|
|
|
|
<td>An example of how to set up planar reflections using the standard multi-pass
|
|
|
|
stencil buffer algorithm. This is all handled within the scene graph, so
|
|
|
|
there is no need to hardwire multi-pass effects into your own application.
|
|
|
|
.</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td><img SRC="images/osgscribe.jpg" BORDER=0 height=100 width=128></td>
|
|
|
|
|
|
|
|
<td><b>osgscribe.cow.osg</b></td>
|
|
|
|
|
|
|
|
<td>An example of how to decorate your scene graph geometry for useful
|
|
|
|
effects such as scribing. This demo uses two instances of your model, the
|
|
|
|
first one uses the state values set in your scene graph, the second instance
|
|
|
|
override the polygmode to render it as wireframe, and with a polygon offset
|
|
|
|
to ensure it is seen from all angles. These two instance are grouped together
|
|
|
|
and then are treated like any other scene graph. </td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td><img SRC="images/osgstereoimage.jpg" BORDER=0 height=100 width=128></td>
|
|
|
|
|
|
|
|
<td><b>osgstereoimage left.rgb right.rgb</b></td>
|
|
|
|
|
|
|
|
<td>An example of use node maks to select different parts of the scene
|
|
|
|
graph for different traversals, in this case two separate images are drawn
|
|
|
|
for the left and right eyes to generate a stereo 3D image from two flat
|
|
|
|
images! .</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td><img SRC="images/osgtext.jpg" BORDER=0 height=100 width=128></td>
|
|
|
|
|
|
|
|
<td><b>osgtext</b></td>
|
|
|
|
|
|
|
|
<td>An example showing how to creating the various different typs of text
|
|
|
|
that the osgText library supports. </td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td><img SRC="images/osgtexture.jpg" BORDER=0 height=100 width=128></td>
|
|
|
|
|
|
|
|
<td><b>osgtexture lz.rgb reflect.rgb</b></td>
|
|
|
|
|
|
|
|
<td>An example showing how to creating the textured quads, each with different
|
|
|
|
texture parameters, including anisotrophic filtering and texture compression! </td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2003-04-11 18:37:31 +08:00
|
|
|
<td><img SRC="images/osgwindows.jpg" BORDER=0 height=100 width=128></td>
|
2002-04-25 21:26:33 +08:00
|
|
|
|
2003-04-11 18:37:31 +08:00
|
|
|
<td><b>osgwindows cow.osg</b></td>
|
2002-04-25 21:26:33 +08:00
|
|
|
|
2003-04-11 18:37:31 +08:00
|
|
|
<td>An example of multiple windows all running at once. </td>
|
2002-04-25 21:26:33 +08:00
|
|
|
</tr>
|
2002-04-24 21:05:03 +08:00
|
|
|
</table>
|
|
|
|
|
|
|
|
</body>
|
2002-04-24 21:08:30 +08:00
|
|
|
</html>
|