Menu
  • HOME
  • TAGS

OpenSceneGraph memory management

c++,memory-management,openscenegraph

osg::ref_ptr<Array> _vertexArray; _vertexArray is defined in the header like this. This means when it is assigned to array in that method, the reference count will increase to 1. When the reference is removed the count will go to 0 and will delete the object. This means you can't rely on...

Why osgviewer works while osgDB::readImageFile() fails?

3d,openscenegraph

I solved my own problem. The reason is that I mixed up two versions of OpenSceneGraph, one is compiled with VS2012 without JPEG plugin and the other is compiled with VS2010 with JPEG plugin. The OSG compiled with VS2010 will not work under VS2012. Now I've found another OSG compiled...

osgWidget label within frame won't trigger the callback

c++,callback,event-handling,openscenegraph

For labels you should first add the push event to the label event mask: label->addEventMask(osgWidget::EVENT_MOUSE_PUSH); Otherwise label->canMousePush() will return false and the callback will never be called....

How to include NodeCallback and MatrixTransform Library in visual studio?

c++,visual-studio-2010,openscenegraph

You need to add the OSG include folder as an include directory to your project. Right-click on the project -> Configuration Properties -> C/C++ -> General -> Additional Include Directories. ...

Different _fileName values in Visual Studio debug watch

c++,visual-studio,debugging,openscenegraph

MSVC++ implementation of std::string uses different storage strategies for short strings and for long ones. Short strings (16 bytes or less) are stored in a buffer embedded directly inside the std::string object (you will see it as _Bx._Buf in Raw View). Long strings are stored in an independently-allocated block of...

How do I rotate/translate existing OpenSceneGraph (OSG) nodes from a loaded .ive model tree?

c++,c,opengl,openscenegraph

Sure, it can be done. You first have to find the nodes that you want to manipulate. You should be able to do this by creating a subclass of osg::NodeVisitor, and using it to traverse the graph until you find the node you want to manipulate. If you've given the...

How can I use C++ OSG objects from Python?

python,c++,openscenegraph

Finally I managed to solve this issue by creating a new python type (python extension) and using Node Visitors to assign node references upon creation.

Check if node visible to camera in OSG

opengl,openscenegraph

You only need to know 3 things to do this: the view direction, the position of the camera and the position of the node (all in the same coordinate system). Then the test is easy: dot(view, nodePos-cameraPos)<0 where dot(v1, v2) is the dot product of 2 vectors in other words...

VS2012 MSVCR120D.dll is missing

c++,visual-studio-2012,dll,openscenegraph

At least one of the libraries you are using is compiled using VC12(2013), so either recompile them (you may see which library is compiled on VC12 using Dependency Walker or install the MSVC 2013 redistributables download from here

Scene Graph Update Callback Design

c++,oop,design-patterns,callback,openscenegraph

osg::NodeVisitor is more or less a textbook implementation of the Visitor Design Pattern. (see http://en.wikipedia.org/wiki/Design_Patterns for more info on the original "Gang of Four", or GoF, book). You can override accept(NodeVisitor) in your t1 node class to try casting to your t1 visitor type, eg: Type1_Visitor* vis = dynamic_cast<NodeVisitor> nv;...

OpenSceneGraph - Real size objects

c++,openscenegraph

My first two thoughts are: You might be able to override the reshape (that's what it is in GLUT, search for the call that pushes a resizeWindow event on the OSG event queue for your particular window system) - always pass it the full width/height of your screen instead of...

SSAO, Opmizations and pipelines using OpenSceneGraph

openscenegraph,concept,ssao

In general, SSAO is best suited to being implemented as part of a deferred shading approach. A strictly forward shading approach is possible, but would still require two rendering passes, and SSAO can easily be added to the second rendering pass of a deferred shading engine. In SSAO, you need...

Set CheckForGLErrors State

openscenegraph

You can obviously use gDEBugger as some of the answers in the thread suggest. If you still want to really do it via osg::State then you can probably add a osg::Drawable::DrawCallback to all your drawables. Then within the drawImplementation of the DrawCallback you can do something like - virtual void...

Object coordinates

c++,qt,openscenegraph

In order to retrieve an object's coordinates from your scene, you'll need to add new event handler to your viewer. Let's call it a PickHandler. Here's a basic code that will get you started. You'll need to add the "includes" and modify it to suit your needs. (Please note that...