Chapter OSG Overview of three-dimensional rendering engines
The main features of OSG include the following:
1. You can efficiently draw and control 3D models built using modeling software, such as 3DMAX, MAYA, creator and other 3D models, which is the basic function of scene rendering.
2. Support a variety of peripherals, such as joystick, joystick, trackball, steering wheel, keyboard and mouse.
3. In addition to the traditional two-dimensional screen on three-dimensional display, OSG can also complete the red and green offset stereoscopic projection, to achieve a true stereoscopic display.
4. Support all kinds of popular animations such as skeletal animation, keyframe animation, color animation and so on.
Related extensions of OSG:
OSG extension, OSG for each specific application, there are a lot of developers to develop and improve, it is commendable that then also open source. The purpose of this article is to allow you to stand on the shoulders of giants and choose to develop on the basis of mature open source libraries that can be found. ----Freesouth Note.
- The combination of OSGBULLET:OSG and Bullet physics engines.
- The combination of OSGCAIRO:OSG and Cairo APIs, Cairo is a 2D graphics library.
- Osgearth: The powerful open source Earth Terrain system based on paging data.
- Osgephemeris: Open source Engineering for model horoscope data.
- Osgocean: Used to simulate the ocean.
- Osgriver: There are enthusiasts based on Osgocean to modify the library of the simulated river.
- Osgppu: A library of OSG-based Post-render.
- The Osgtoy and OSGVRPN:OSG utility library contains a combination of OSG and VRPN.
- Osgworks: A OSG Tool library that contains a lot of practical classes.
- Osgtransparencytoolkit: A OSG utility library that implements multiple transparency.
- Osg. JS: Using JS to implement the OSG.
- Osgandroid: A tool library for developing OSG programs on Android.
- Osgrecipes:array-led, combines OSG with Anttweakbar, Assimp, Awesomium, Freeimage, Kinect, PhysX, Spark, Tuio, VLC and a collection library.
- OSGEXP: Used to export the model to osg/ive in 3DMAX.
- OSGNV: Provides some examples of support for the CG language for OSG.
- OSGART:OSG's augmented Reality library.
- Some examples of shader written by OSGGLSL:OSG.
- Osgtoy:toys for OSG.
- Osgvisual: A terrain visualization library containing OSG and sliverning, Triton combined functions.
- Osgxi:array-led includes a number of GPU effects and game development components, as well as support for CG and Maya export.
- DELTA3D: OSG-based military simulation library developed by the U.S. Naval Institute.
- OSGHIMMEL:OSG Another and the Sky Horoscope Simulation library.
- Osgephemeris: Celestial and astrological simulation software.
- FlightGear: OSG-based, highly professional flight simulation software with a Osgearth version.
- OSGCAL:OSG and Cal-bonded libraries. Cal is made of skeletal animation.
- A library of OSGHAPTICS:OSG and haptics. Haptics is a tactile-related system.
- Osgvirtualenvironment:configurable, device-independent virtual reality engine built on top of openscenegraph.
- Osgaudio:3d Sound Library, combining OSG with Fmod.
- Osgal:3d Sound Library, combining OSG with OpenAL.
- Osgmodeling:array-dominated, the use of OSG Giambesel curved surface and other mathematical models of the library.
- Osgode: A library that combines OSG with Ode, Ode is a physical engine.
- Osgsmallcity: As stated in its name, the model is a small city.
- The combination of OSGPANGO:OSG and Pango, Pango is a professional text rendering library, such as: can render the beating of text and so on.
OSG's Learning materials
1. "OpenSceneGraph Reference Manual" (OpenSceneGraph Refrence Manuals)
2. OpenSceneGraph Quick Start Guide (openscenegraph Quick Start guides)
3. "Longest Frame"
4. "OpenSceneGraph three-dimensional rendering engine design and practice"
5. OpenSceneGraph 3.0 Beginner ' s Guide
6. "OpenSceneGraph three-dimensional rendering engine Programming Guide"
7. "OpenSceneGraph Program Design"
Compilation and installation of OSG
Source code package Download: Http://www.openscenegraph.org/downloads/developer_releases/OpenSceneGraph-3.2.0.zip
Third-party libraries download: http://trac.openscenegraph.org/projects/osg/wiki/Downloads/Dependencies
Data File Download: http://trac.openscenegraph.org/projects/osg/wiki/Downloads/SampleDatasets
CMAKE Compile configuration:
Tick the following optional options:
Build_mfc_example
Build_osg_application
Build_osg_examples
Configuration 3rdParty:
Collada_dom_root:x:\3rdparty\include\1.4\dom
Collada_zlib_library:x:\3rdparty\lib/zlib1.lib
Curl_include_dir:x:\3rdparty\include
Culr_library:x:\3rdparty\lib\curllib.lib
Culr_library_debug:x:\3rdparty\lib\curllibd.lib
Freetype_include_dir:x:\3rdparty\include
Freetype_include_dir_freetype2:x:\3rdparty\include
Freetype_include_dir_ft2build:x:\3rdparty\include
Freetype_library:x:\3rdparty\lib\freetype237.lib
Freetype_library_debug:x:\3rdparty\lib\freetype237d.lib
Giflib_include_dir:x:\3rdparty\include
Giflib_library:x:\3rdparty\lib\giflib.lib
Giflib_library_debug:x:\3rdparty\lib\giflibd.lib
Glut_include_dir:x:\3rdparty\include
Glut_library:x:\3rdparty\lib\glut32.lib
Glut_library_debug:x:\3rdparty\lib\glut32d.lib
Glut_glut_library:x:\3rdparty\lib\glut32.lib
Jpeg_include_dir:x:\3rdparty\include
Jpeg_library:x:\3rdparty\lib\libjpeg.lib
Jpeg_library_debug:x:\3rdparty\lib\libjpegd.lib
Png_include_dir:x:\3rdparty\include
Png_library:x:\3rdparty\lib\libpng13.lib
Png_library_debug:x:\3rdparty\lib\libpng13d.lib
Tiff_include_dir:x:\3rdparty\include
Tiff_library:x:\3rdparty\lib\libtiff.lib
Tiff_library_debug:x:\3rdparty\lib\libtiffd.lib
Zlib_include_dir:x:\3rdparty\include
Zlib_library:x:\3rdparty\lib\zlib1.lib
Zlib_library_debug:x:\3rdparty\lib\zlib1d.lib
Note: cmake-g "Visual Studio 12 2013"
The organization structure of OSG
OSG uses a namespace-based development model where each namespace represents a large class of features, such as Osgdb, Osgviewer, OSGFX, Osgshadow, and so on. In general, OSG components are divided into the following areas:
OSG Core Library: Provides the basic functions of OSG rendering and process;
OPENTHREADS:OSG use Openthreads to complete process management;
OSG Library: Provides the most basic functions of rendering, as well as scene node management, graphics rendering, and rendering state management functions;
OSGDB Library: To provide read and write functions to the model, and read-write related functions are used such scheduling, including data paging management and other functions;
Osgga Library: Provide incident response function, through the interaction with the operating system, so that the program can respond to external events, such as keyboard, mouse, steering wheel and other events;
Osgviewer Library: Provides the framework of the OSG program, which can be understood as the scene management library;
Osgutil Library: To provide some useful functions such as drawing optimization, such as the triangle surface drawing function, normal generation function, etc.
Node Toolbox: Extend OSG core functionality to provide some special effects and advanced features for OSG rendering scenes, such as animations, shadows, large terrain, text display, etc.;
Osganimation: Scene animation processing library;
OSGFX: Scene effect library;
Osgmanipulator: Provide some operators, such as trackball, driving and so on;
Osgparticle: Particle system Library, provide some practical functions, such as rain effect, snow effect, flame, etc.
Osgshadow: Provides scene shadow rendering function and supports various shadow rendering techniques;
Osgsim: Simulation Tool library, including DOF node, point Light source and many other related functions of virtual simulation;
Osgterrain: A terrain processing library for reading and displaying real-time terrain;
Osgtext: word processing library;
Osgvolume: Implement body rendering, and provide technical support for various body rendering;
OSGWIDGET:OSG UI Library, provide buttons, tab bar and other common UI design functions;
Osgintrospection: Encapsulates the implementation code that OSG interacts with other languages;
OSG file read-write plugin: Provides the model format supported by OSG, almost including all images and 3D model formats.
OSG Common Tools
Osgviewer: Model View Tool
Osgversion: library version detection
Osgarchive: Compression Tool
OSGCONV: Format conversion and compression tools
Chapter II OSG Application Foundation
Incident response
Basic geometric entities
Model Reading and writing
Model control
Super pointer
Chapter III Human-Computer interaction and animation control
OSG Incident Response Mechanism
Most applications respond to keyboard and mouse events, and keyboard and mouse events are standard events for the operating system, which are captured by the system and placed in the message queue and processed by an application process.
Animation
MD2 model format is a popular model format in large-scale online games, and OSG has plugins that support reading MD2 formats.
Keyframe animations, also called Vertex animations, are animated by drawing each frame, and each frame is actually a "snapshot" of the model's particular posture. By interpolating between frames, you can get a smooth animation effect. It's kind of like putting each action on paper and finally flipping through it to form an animation.
Skeletal animation refers to the skeleton structure of a model with interconnected "bones" that animate the model by altering the orientation and position of the bones. skeletal animations require more processor performance than vertex animations, but they also have more advantages, and skeletal animations can be created more easily and quickly. It is important to note that only the matrix is unable to form the animation, but also the need to skin, in addition to the movement of the skin, to drive the skin, the formation of animation.
OSG defining skeletal animation consists of three parts: bone, skin, and skeletal movement.
Skeleton (Osganimation::skeleton): The skeleton that holds the skeleton, the root node of each bone, is attached to a skeleton.
Bone (Osganimation::bone): a matrix transformation that truly composes the entire skeletal animation.
Motion (Osganimation::basicanimationmanager): A class used to manage the movement of bones, each of which corresponds to a channel.
Skinning (Osganimation::riggeometry): Defines the skin and associates the bone and skin with Osganimation::vertexinfluencemap.
Fourth chapter roaming, following and collision detection
The operator is almost the foundation of any VR project. Bots are an important part of the operator, and one of the most important requirements for bots is roaming in a manner that is required by the user.
The core manager of the scene in OSG is the viewer, and when roaming needs to respond to events such as mouse movement, the scene changes as well, and the class that responds to the event is Osgga::guieventhandler.
OSG 3.0 three-dimensional visual simulation technology development detailed