= Tutorials = [[TracNav(TracNav/SupportTOC)]] Tutorials should help newbies or other users in general to get ideas how to solve problems with a specific tasks. They differ from examples because tutorials come with a written or spoken (video tutorial) guidance through the code. Please feel free to add new tutorials if you find something that is not covered or for your own examples. == Basic == Tutorials aimed at first time users of OpenSceneGraph looking for some introductory tutorials. You can download full source code and data files from [http://www.openscenegraph.org/projects/osg/attachment/wiki/Support/Tutorials/NPS_Tutorials_src.rar '''NPS_Tutorials_src.rar'''] * [wiki:Support/Tutorials/BasicGeometry Basic geometry] Creation of a vertex colored pyramid geometry. * [wiki:Support/Tutorials/Textures Textures] Addition of a texture to the pyramid geometry. * [wiki:Support/Tutorials/TransformsAndStates Transforms and States] Using shapes for geometry, position them with transforms and change texture states. * [wiki:Support/Tutorials/StateSets StateSets] About inheriting, overriding and protecting states. * [wiki:Support/Tutorials/FileLoadingAndTransforms File loading and transforms] * [wiki:Support/Tutorials/HudsAndText HUDs and Text] * [wiki:Support/Tutorials/FindingNodes Finding nodes, DOFs and Switches] * [wiki:Support/Tutorials/Callbacks Callbacks] * User input * [wiki:Support/Tutorials/KeyboardHandler Keyboard handler class] * [wiki:Support/Tutorials/BasicKeyboardInput Basic keyboard input] * [wiki:Support/Tutorials/CameraControl Camera control] * [wiki:Support/Tutorials/CameraControlNodeFollowing Following a node] * [wiki:Support/Tutorials/CameraControlNodeOrbiting Orbiting a node] * [wiki:Support/Tutorials/CameraControlFindingWorldCoordinates Finding World Coordinates] * Custom window & camera layouts * [wiki:Support/Tutorials/TwoCameras Two cameras] * [wiki:Support/Tutorials/MultipleCameras Multiple cameras] * Shaders * [wiki:Support/Tutorials/ShadersIntroduction Introduction] * [wiki:Support/Tutorials/ShadersParameters Parameters] * [wiki:Support/Tutorials/ShadersUpdating Updating] * [wiki:Support/Tutorials/ShadersSampleGrayingOut Sample - graying out] * [wiki:Support/Tutorials/Billboards Billboards] * [wiki:Support/Tutorials/Intersections Intersections] * [wiki:Support/Tutorials/ParticleEffects Particle effects] * [wiki:Support/Tutorials/LoadingParticleEffects Loading particle effects] * [wiki:Support/Tutorials/NodeMaskDemo Node mask demo] * [wiki:Support/Tutorials/NodeMaskDemoII Node mask demo II] == Yet Another Set of Beginner Tutorials == From my own experience in using OpenSceneGraph, I have written these tutorials in order to help any new comers to this lovely graphics toolkit. These tutorials are mainly intended to Linux users but other users can still use the enclosed codes. By [wiki:Community/People/FranclinFoping Franclin Foping] * Tutorial 1: An overview of OpenSceneGraph * This first tutorial desribes the architecture of OpenSceneGraph. There is no source code for it. Please download the file [attachment:Tuto1.zip Tuto1.zip] * Tutorial 2: Rendering a simple geometry * This tutorial will show you how to render a simple geometry: a shape drawable. The source code and the tutorial itself can be downloaded from the attached file [attachment:Tuto2.zip Tuto2.zip]. Remember to edit the Makefile by typing the right path for your OSG installation. * Tutorial 3: Memory management (Referenced pointers) * This tutorial will explain referenced pointers. It is based on Don Burns' atricle. Download the file here [attachment:Tuto3.zip Tuto3.zip]. Remember to edit the Makefile by typing the right path for your OSG installation. * Tutorial 4: Functors * This tutorial will explain how OSG uses functors which is an advanced C++ topic. Get the file here [attachment:Tuto4.zip Tuto4.zip]. * Tutorial 5: Installing OSG on a Linux platform * This tutorial will explain how to setup under Linux. Get the file here [attachment:Tuto5.zip Tuto5.zip]. * Tutorial 6: Materials in OSG * This tutorial will show you how to add materials to your objects. [attachment:Tuto6.zip Tuto6.zip]. Remember to edit the Makefile by typing the right path for your OSG installation. * Tutorial 7: Texturing, multitexturing and positioning objects * Download the file here [attachment:Tuto7.zip Tuto7.zip]. Remember to edit the Makefile by typing the right path for your OSG installation. * Tutorial 8: Watch out that morning fog! * A fogging effect in OSG. Download the file here [attachment:Tuto8.zip Tuto8.zip]. Remember to edit the Makefile by typing the right path for your OSG installation. * Tutorial 9: Let light be! * Shading your scene. Get the file here [attachment:Tuto9.zip Tuto9.zip] * Tutorial 10: OpenGL code in OSG * Coding in OpenGL in OSG. Get the file here [attachment:Tuto10.zip Tuto10.zip] * Tutorial 11: Billboarding in OSG * How to add a billboard to your scene. File is here: [attachment:Tuto11.zip Tuto11.zip] * Tutorial 12: Simple shadow effect * Using the shadow effect in OSG. The file is here: [attachment:Tuto12.zip Tuto12.zip] * Tutorial 13: Switching nodes in OSG * This tutorial will give you an example of the Switching nodes. File: [attachment:Tuto13.zip Tuto13.zip] * Tutorial 14: Adding shaders to your scene * This tutorial will show you how to add shaders to your scene. Here is the file [attachment:Tuto14.zip Tuto14.zip] * All Tutorials access from one file by Franclin Foping [attachment:osgTutorial.zip osgTutorial.zip] == Advanced == Tutorials that go in depth into more specific topics. * [wiki:Support/Tutorials/LoadingProgress osgDB loading progress] How to add a progress bar for file loading with osgDB * [wiki:Support/Tutorials/VFS Loading from a virtual file system] * [http://www.openscenegraph.org/projects/osg/attachment/wiki/Support/Tutorials/OSG_Tutorial_Ball.zip OpenSceneGraph TutorialBall] Some e-book, lectures and thesis about OpenSceneGraph == Miscellaneous tutorials == Tutorials that are platform specific or go into integrating other libraries with OSG. * [wiki:Support/Tutorials/MacOSXTips Mac OS X Tips ] == External tutorial links == * [http://faculty.nps.edu/jasullivan/osgtutorials/ osgTutorials] [wiki:Community/People/JosephSullivan Joseph Sullivan] (integrated into this Wiki) * [http://www.reflex.lth.se/sovri/library/examples/compiling/01GettingStarted/ OpenSceneGraph with OSGExp] A tutorial by [wiki:Community/People/RoyDavies Roy Davies] on exporting .osg or .ive scenes from 3DStudio Max with help of the OSGExp exporter plugin. * [http://www.cs.clemson.edu/~malloy/courses/3dgames-2007/tutor/ 3D Game Development Tutorials Using SDL and OSG] (by Rob Morefield and Brian Malloy) = Examples = * [wiki:Support/UserGuides/Examples OpenSceneGraph examples] == External examples == * Example programm of a morphing cube with option to do the morphing using Vertex Buffer Objects (VBO) either on the CPU or on the GPU (GLSL). Shows how to setup and pass vertex attributes to GLSL in OSG and setup VBO geometry for GLSL (GPU) moprhing. Shows how to setup VBO and do updates for CPU morphing. [attachment:osgGPUMorph.3.zip osgGPUMorph.3.zip] (by [wiki:Community/People/DimiChristopoulos Dimi Christopoulos]) * [http://www.fx.clemson.edu/~acnatha/devnull/osg/osgmanylights.tar.gz osgmanylights.tar.gz] - An example of using `osgUtil::RenderStage` for multipass rendering. (by [wiki:Community/People/NathanCournia Nathan Cournia]) * OSG Examples: some examples I created while learning OSG. Most of them are pretty well commented, and I think they are simpler than the "standard" examples distributed with OSG. May be useful for someone else. Last update: November 8th 02006. [attachment:LMBs_OSG_Examples.zip LMBs_OSG_Examples.zip]. (by [wiki:Community/People/LeandroMottaBarros Leandro Motta Barros]). MS Visual Studio 2005 version with support for OSG v2.2 [attachment:LMBs_OSG_Examples_OSG22_VS2005.zip LMBs_OSG_Examples_OSG22_VS2005.zip] (by Kari.Rainio@vtt.fi). * ODE Demo: a little Open Dynamics Engine ([http://www.ode.org ODE]) example that uses OSG for visualization. [attachment:LMBs_ODE_Demo.zip LMBs_ODE_Demo.zip]. Patch by Hans Ulrich Niedermann to use osgViewer instead of osgProducer: [http://osg.lauft.net/LMBs_ODE_Demo-osgViewer.patch LMBs_ODE_Demo-osgViewer.patch] (by [wiki:Community/People/LeandroMottaBarros Leandro Motta Barros]) * Bullet demo: a little demo application showing integration of OSG and ([http://www.bulletphysics.com/ Bullet]) physics engine. Using osgProducer:[attachment:bullet-test.tar.gz bullet-test.tar.gz], using new osgViewer:[attachment:bullet-test-osg2.6up.tar.gz bullet-test-osg2.6up.tar.gz]. Archive contains a CDT project (Eclipse C++ IDE), the code is tested and working with Bullet 2.68 and OSG 2.4 upwards (by [wiki:Community/People/JanCiger Jan Ciger]). * [http://www.3dcalc.pl/osg-examples/osgHavok.zip] - A Havok demo: an example that illustrates the OSG and Havok integration. The archive contains a Visual Studio Express 2005 project. The code has been tested against osg 2.7.6 and 2.7.7. By Janusz Goldasz (janusz at 3dcalc.pl) * [http://www.3dcalc.pl/osg-examples/osgPhysXDemos.zip] - A PhysX demo: a number of demo scenes that show the OSG and NVIDIA's PhysX integration. The scenes involve rigid bodies, soft bodies, fluids, simple character controllers, joints, actor picking. The archive contains a Visual Studio Express 2005 project. The code has been tested against osg 2.4.0, 2.7.6 and 2.7.7. By Janusz Goldasz (janusz at 3dcalc.pl) * High Dynamic Range examples: this examples demonstrate the use of GL_NV_float_buffer extension with OSG. [attachment:HDRTutorials.zip HDRTutorials.zip] (by [wiki:Community/People/FabioMierlo Fabio Mierlo]) == Broken links == Tutorials/examples that need their links fixed or need to be added to this Wiki. * Three introductory tutorials written in Chinese. Direct link not available anymore, but the tutorials are still available in an [http://download.mapalpha.com/vrdev/VRDEV-OSG-STUDY-KIT-1.0.iso VRDEV-OSG-STUDY-KIT-1.0.iso] (230 Mb!) which also contains collected data on osgExp, Delta3D and the NPS tutorials. (by [wiki:Community/People/TaoJi TaoJi])