[osg-users] Using OSG Embedded in an Existing OpenGL Project

2012-09-17 Thread Dainon Woudstra
Hi,

Background:
I've written an application in C# for various reasons. SharpGL provided the 
OpenGL portion, C# provided the Database, and Intellisense works with it in VS 
2010. I've rewritten this application in 3 different frameworks and have hit 
issues I could not solve for one reason or another. For example, now that my 
application works and I use it everyday, I'm trying to enhance some of its 
features, such as loading a 3D object and good text rendering.

I've come across OpenSceneGraph and have been trying to use it with the C# 
wrappers. I couldn't get that working and read a bunch of posts providing other 
solutions and mentioning it isn't supported anymore. Thus, I've learned to 
write a wrapper for a C++ OSG DLL to call some native OSG functions.

It works great, except that it doesn't, LOL. The code it fine, I've tested it 
in a sample, non C# application using the viewer and all.

The Question:
The part that I don't understand is how to use OSG to render in an existing 
OpenGL viewport. Is there a way to attach to the existing OpenGL instead of 
creating the OSG viewer as noted in every OSG example I've seen?

C# SharpGL initialization

Code:

// Initialize SharpGL
void initSharpGL() {
   openGLControl = new SharpGL.OpenGLControl();
   ((System.ComponentModel.ISupportInitialize)(openGLControl)).BeginInit();

   // 
   // openGLControl
   // 
   openGLControl.BitDepth = 32;
   openGLControl.Dock = System.Windows.Forms.DockStyle.Fill;
   openGLControl.DrawFPS = true;
   openGLControl.FrameRate = 60;
   openGLControl.Location = new System.Drawing.Point(0, 0);
   openGLControl.Name = openGLControl;
   openGLControl.RenderContextType = SharpGL.RenderContextType.FBO;
   openGLControl.Size = new System.Drawing.Size(1680, 1060);
   openGLControl.TabIndex = 0;
   openGLControl.OpenGLInitialized += new 
System.EventHandler(openGLControl_OpenGLInitialized);
   openGLControl.OpenGLDraw += new 
System.Windows.Forms.PaintEventHandler(openGLControl_OpenGLDraw);
   openGLControl.Resized += new System.EventHandler(openGLControl_Resized);
   openGLControl.Click += new System.EventHandler(OpenGL_Click);
   ((System.ComponentModel.ISupportInitialize)(openGLControl)).EndInit();
   Controls.Add(openGLControl);

   ...
}




Native OSG Code:

Code:

// Create the scene root
mRoot = new osg::Group;

// The viewer
mViewer = new osgViewer::Viewer;
mWindow = mViewer-setUpViewerAsEmbeddedInWindow(0, 0, 1680, 998);
mViewer-getCamera()-setClearMask(0);
mViewer-setSceneData(mRoot);
mViewer-realize();

osg::ref_ptrosg::Geode geode = new osg::Geode;

std::string fontFile(arial.ttf);
font = osgText::readFontFile(fontFile);
if (font.valid()) {

   osgText::Text* text = new osgText::Text;
   if (text != 0) {
  text-setFont(font);
  text-setColor(osg::Vec4(0.0f, 1.0f, 1.0f, 1.0f));
  text-setCharacterSize(40.0f);
  text-setPosition(osg::Vec3(100.0f, 100.0f, 0.0f));
  text-setText(SomeSome!);

  text-setLayout(osgText::Text::LEFT_TO_RIGHT);

  geode-addDrawable(text);
   }
}

mRoot-addChild(geode);




The OSG Draw Callback function contents

Code:

mViewer-frame();




Thank you!

Cheers,
Dainon

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=49871#49871





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Hello All

2012-09-17 Thread Ryan Ron
Hi Guys,


I am Newbie here.. Just want to say hello all of you..


Thank you!

Cheers,
Ryan

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=50080#50080





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Is there something like an optimal way for integrating physics?

2012-09-17 Thread funk menera
Hi,

propably the answer depends on what is to be done with physics. (and has been 
discussed before?)

But i'm curious if someone can post his/her experiences with OSG and 
physics-integrations concerning performance differences.

Well, up to now i only tried PhysX ... and my answer rised because i found 
three ways for integrating PhysX:
- callback
- GUIEventAdapter
- node-integration
There might be more ...


Finally, let me say that i wanna do something in the direction of vehicle 
dynamics.
First using the 'pre-defined models', but afterwards maybe creating a more 
sophisticated model.
So i'm pretty sure, that i could use any physics engine ... maybe Bullet is 
better to be integrated into OSG than PhysX? Or the way round? Or Havok is 
faster?

Basically, i'm just wondering if there are 'notable' differences in performance 
concerning the different physics-SDKs and their ways of integration? 
(Especially in terms of vehicle dynamics)

Thank you very much!

Cheers,
funk

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=50073#50073





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Memory leak notify handler

2012-09-17 Thread Markus Hochstrasser
Hi,

I'm new here, and quite new in the OSG world :) 

I use Visual Studio 2008 with Visual Leak Detector to dump memory leaks.  I 
tried to rebuild an example from OpenSceneGraph Beginners Guide - page 58 to 
redirect the OSG notify stream as follows. Unfortunately Visual Leak Detector 
indicates a memory leak (new LogFileHandler...) - so I wonder if this really a 
leak or just a false positive? Actually I cannot see the error...


osg::setNotifyLevel( osg::INFO );
osg::setNotifyHandler( new LogFileHandler(output.txt) ); -- the 
potential leak

(Sorry I wanted to post the full code, but I get an error like you need at 
least 2 posts to include links/urls even if my code doesn't include any urls)

Thank your very much!

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=49450#49450





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgDB::readNodeFile returning null after an excessive amount of calls

2012-09-17 Thread Zach Lenker
Thanks for the reply, I actually figured out what the issue was over the 
weekend. I was hitting a hard limit, of 512, for how many I/O files can be open 
at the same time with stdio. I used the _setmaxstdio function to help with 
that, but the major problem was caused by me not closing some files that get 
continually reopened.

Cheers,
Zach

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=49365#49365





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] How to draw a simple frustum wireframe cube?

2012-09-17 Thread Charma Man
Hello Forum,

I am an absolute osg-beginner. I am currently working on a very huge project 
which is using osg. I now would like to draw something in the existing scene 
without messing everything up. I will try to give you as much detail as I can 
to make it easier to understand.

I have access to a callback-function which is called before every frame 
drawing. Also I have access to the two matices


Code:
this-rootTransform = opencover::cover-getObjectsXform()-getMatrix();

// Get camera frustum parameters
osg::Matrix matProj = 
opencover::coVRConfig::instance()-screens[0].camera-getProjectionMatrix();

matProj.getFrustum(
this-frustum.left,
this-frustum.right,
this-frustum.bottom,
this-frustum.top,
this-frustum.znear,
this-frustum.zfar
);




As you probably see the call opencover::coVRConfig::instance() also returns the 
instance. What I would like to do now is draw some simple lines (as in like 
glBegin) but in screen coordinates, so with positions in the frustum corners 
like (1,1,1) or (1,-1,-1).

The reason for this is that I want to make the whole frustum visible because 
I am using a stereoscopic VR-renderer and I want to validiate how big the 
frustum is and when do you step into the 3D scene.

I hope anyone can help me with this and can provide some simple sample code. If 
you need more detail, feel free to ask back.

Thank you!

Cheers,
Charma

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=50045#50045





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Depth buffer questions

2012-09-17 Thread Andrey Shvartsman
For some reason the forum software is not letting me post the full code yet, 
because I don't have 2 posts yet. Hopefully after this post I will be able to 
post the full code.

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=50032#50032





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Depth buffer questions

2012-09-17 Thread Andrey Shvartsman
Full code attached below:


Code:

/* -*-c++-*- OpenSceneGraph Cookbook
 * Chapter 6 Recipe 4
 * Author: Wang Rui 
*/

#include osg/Texture2D
#include osg/Group
#include osgDB/ReadFile
#include osgViewer/Viewer

#include CommonFunctions
#include osg/io_utils
#include sstream
osg::ref_ptrosg::Image image = new osg::Image; 

// class to handle events with a pick
class PickHandler : public osgGA::GUIEventHandler {
public: 

PickHandler() {}

~PickHandler() {}

bool handle(const osgGA::GUIEventAdapter ea,osgGA::GUIActionAdapter aa);

virtual void pick(osgViewer::View* view, const osgGA::GUIEventAdapter ea);

};

bool PickHandler::handle(const osgGA::GUIEventAdapter 
ea,osgGA::GUIActionAdapter aa)
{
switch(ea.getEventType())
{
case(osgGA::GUIEventAdapter::PUSH):
{

if(ea.getButton()==osgGA::GUIEventAdapter::LEFT_MOUSE_BUTTON )
{
osgViewer::View* view = dynamic_castosgViewer::View*(aa);
if (view) pick(view,ea);
}
return false;
}
  
default:
return false;
}
}

void PickHandler::pick(osgViewer::View* view, const osgGA::GUIEventAdapter ea)
{
osgUtil::LineSegmentIntersector::Intersections intersections;

std::string gdlist=;
float x = ea.getX();
float y = ea.getY();
float z, z_buffer;
if (view-computeIntersections(x,y,intersections))
{
for(osgUtil::LineSegmentIntersector::Intersections::iterator hitr = 
intersections.begin();
hitr != intersections.end();
++hitr)
{
std::ostringstream os;
if (!hitr-nodePath.empty()  
!(hitr-nodePath.back()-getName().empty()))
{
// the geodes are identified by name.
osObject 
\hitr-nodePath.back()-getName()\std::endl;
}
else if (hitr-drawable.valid())
{
osObject \hitr-drawable-className()\std::endl;
}

oslocal coords vertex( 
hitr-getLocalIntersectPoint())  
normal(hitr-getLocalIntersectNormal())std::endl;
osworld coords vertex( 
hitr-getWorldIntersectPoint())  
normal(hitr-getWorldIntersectNormal())std::endl;
const osgUtil::LineSegmentIntersector::Intersection::IndexList vil 
= hitr-indexList;
for(unsigned int i=0;ivil.size();++i)
{
osvertex indices [i] = vil[i]std::endl;
}
for(int k=0; k32; k++)
{
for(int l=0; l32; l++)
{
z_buffer=((float*)image-data(k,l))[0];
z=-1/(z_buffer-1);
std::cout z  ;
}
std::coutstd::endl;
}
std::coutstd::endl;

//z=-1/(z-1);
   // std::coutos.str() Z: z  mstd::endl;
gdlist += os.str();
}
}

   // setLabel(gdlist);
}


int main( int argc, char** argv )
{
osg::ArgumentParser arguments( argc, argv );
osg::ref_ptrosg::Node scene = osgDB::readNodeFiles( arguments );
if ( !scene ) scene = osgDB::readNodeFile(E:\\Point2\\Point2.ive);

osg::ref_ptrosg::Texture2D tex2D = new osg::Texture2D;
tex2D-setTextureSize( 32, 32 );
tex2D-setInternalFormat( GL_DEPTH_COMPONENT24 );
tex2D-setSourceFormat( GL_DEPTH_COMPONENT );
tex2D-setSourceType( GL_FLOAT );

osg::ref_ptrosg::Camera rttCamera = 
osgCookBook::createRTTCamera(osg::Camera::DEPTH_BUFFER, tex2D.get());
rttCamera-addChild( scene.get() );

osg::ref_ptrosg::Camera hudCamera = osgCookBook::createHUDCamera(0.0, 
1.0, 0.0, 1.0);
hudCamera-addChild( osgCookBook::createScreenQuad(0.5f, 1.0f) );
hudCamera-getOrCreateStateSet()-setTextureAttributeAndModes( 0, 
tex2D.get() );

osg::ref_ptrosg::Group root = new osg::Group;
root-addChild( rttCamera.get() );
root-addChild( hudCamera.get() );
root-addChild( scene.get() );

osgViewer::Viewer viewer;
viewer.getCamera()-setComputeNearFarMode( 
osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR );
viewer.setSceneData( root.get() );

viewer.getCamera()-attach(osg::Camera::DEPTH_BUFFER,image); 

image-allocateImage(32,32,1,GL_DEPTH_COMPONENT,GL_FLOAT); 
 viewer.addEventHandler(new PickHandler());
return viewer.run();
}





--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=50033#50033





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] [ANN] OSG SW SIM Engineer

2012-09-17 Thread Craig Hicks
Hello dear OSG-community,

I have a direct position for a simulation client of mine that can be done 
off-site.  This is for a solid OSG programmer in the simulation arena.  Salary 
is open at this point so if you are interested, please give me a holler back.

Best regards,
Craig

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=50028#50028





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] [build] Error Building OSG3.1.1 on linux in ReaderWriterJP2

2012-09-17 Thread benjamin bish
Hi,
   I'm trying to build OSG 3.1.1 in PCLinuxOS 2012 32bit (mandriva based). I'm 
getting an error at ReaderWriterJP2.o

Code:
Scanning dependencies of target osgdb_jp2
[ 81%] Building CXX object 
src/osgPlugins/jp2/CMakeFiles/osgdb_jp2.dir/ReaderWriterJP2.o
/home/benjamin/flightgear2.9/src/OpenSceneGraph-3.1.1/src/osgPlugins/jp2/ReaderWriterJP2.cpp:
 In member function ‘virtual osgDB::ReaderWriter::ReadResult 
ReaderWriterJP2::readImage(const std::string, const 
osgDB::ReaderWriter::Options*) const’:
/home/benjamin/flightgear2.9/src/OpenSceneGraph-3.1.1/src/osgPlugins/jp2/ReaderWriterJP2.cpp:224:85:
 error: ‘jas_stream_freopen’ was not declared in this scope
/home/benjamin/flightgear2.9/src/OpenSceneGraph-3.1.1/src/osgPlugins/jp2/ReaderWriterJP2.cpp:
 In member function ‘virtual osgDB::ReaderWriter::WriteResult 
ReaderWriterJP2::writeImage(const osg::Image, const std::string, const 
osgDB::ReaderWriter::Options*) const’:
/home/benjamin/flightgear2.9/src/OpenSceneGraph-3.1.1/src/osgPlugins/jp2/ReaderWriterJP2.cpp:428:86:
 error: ‘jas_stream_freopen’ was not declared in this scope
make[2]: *** [src/osgPlugins/jp2/CMakeFiles/osgdb_jp2.dir/ReaderWriterJP2.o] 
Error 1
make[1]: *** [src/osgPlugins/jp2/CMakeFiles/osgdb_jp2.dir/all] Error 2
make: *** [all] Error 2



I have jasper packages installed: jasper libjasper1 libjasper1.701_1 
libjasper1.701_1-devel libjasper-devel

I'm building out of source:

Code:
cmake -D CMAKE_BUILD_TYPE=Release -D 
CMAKE_INSTALL_PREFIX=/home/benjamin/flightgear2.9 ../OpenSceneGraph-3.1.1



I don't know what's going on. Please help.

Thank you!
benjamin

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=49958#49958





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] VertexBufferObject filled with CUDA

2012-09-17 Thread wangshunli

JulienH wrote:
 Hi,
 
 I would like to use a osg::VertexBufferObject to draw a geometry.
 My VertexBufferObject data are generated with CUDA and needs to be updated at 
 each frame.
 
 I'm quite new to OSG and I'm wondering how to it.
 My initial guess was to create a native OpenGL VBO, to put it in a 
 osg::GLBufferObject and then fill my osg::VertexBufferObject using 
 setGLBufferObject method.
 I guess that updating my native OpenGL VBO at each time step (thanks to 
 CUDA-OpenGL interop) should also update my osg::VertexBufferObject...
 
 Do you think this idea could work ? Is there a better way to do it ?
 
 Thank you!
 
 Cheers,
 Julien

Hello, Julien:
I have the same problem with you, and I am wondering how do you solve it at 
last?

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=49891#49891





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] PROTO nodes are not reading

2012-09-17 Thread Mahesh Manni
Hi,

Can somebody tell me how to traverse PROTO keywords in VRML API 0.17.12?
... 

Thank you!

Cheers,
Mahesh

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=49916#49916





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] osgViewer takes over my standard input

2012-09-17 Thread Christoffer Pettersson
Hello, I'm trying to write a program where the renderer is running on a 
separate thread. On the main thread I want to control the command line inputs 
but as soon as I add scenedata to the osgViewer which is stored in the renderer 
then the renderer takes over the standard input. std::cin in the main thread is 
ignored. If I put std::cin in the renderer thread however the program pauses 
and expects an input from the command line.

Does anyone know how I can prevent osgViewer from taking over the command line? 
I have attached sample code to this post where I demonstrate the problem.


Code:

#include 
#include 
#include 

class MiniRenderer: public OpenThreads::Thread 
{ 
public: 
void addModel(osg::Node* node) 
{ 
_nodes.push_back(node); 
} 

void run() 
{ 
_viewer.setUpViewInWindow(0, 0, 640, 480); 
_viewer.realize(); 
_sceneRoot = new osg::Group; 
_run = true; 
while(_run) 
{ 
if(_nodes.size()0) 
{ 
for(unsigned int i = 0; i  _nodes.size(); ++i) 
_sceneRoot-addChild(_nodes[i]); 
_nodes.clear(); 
_viewer.setSceneData(_sceneRoot.get()); 
} 
int test = -2; 
std::cout  In Thread:   std::endl; 
std::cin  test; 
std::cout  In Thread :   test  std::endl; 
_viewer.frame(); 
} 
} 
bool _run; 
osg::ref_ptr _sceneRoot; 
osgViewer::Viewer _viewer; 
std::vector  _nodes; 
}; 


int main( int argc, char **argv ) 
{ 
std::cout  Starting thread  std::endl; 
MiniRenderer *minirenderer = new MiniRenderer(); 
mr-startThread(); 

osg::ref_ptr root = osgDB::readNodeFile(cessna.osg); 
minirenderer-addModel(root); 
int test = -1; 

std::cout  Main cin  std::endl; 
std::cin  test; 
std::cout  Main cin:   test  std::endl; 

while(true) 
{ 

} 
return 0; 
} 




Kind Regards
Hoffe

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=49913#49913





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OSG + Qt + Thread exception thread::run

2012-09-17 Thread Francisco
Hi,
first off all sorry if is not easy to understand me because I can´t speak 
English. I'm new to these issues and I have not much experience programming :)
I'm trying to run a sample of OpenScenGraph Cookbook 3.

It only works in release mode running it from Visual C + + 2008. In debug mode 
or running it from outside VC++ doesn't work. I get an exception: access 
violation ... blabla in subprocess RenderThread::run.

It's strange because the other day it runs ok sometimes.

The code is:
_

/* -*-c++-*- OpenSceneGraph Cookbook
 * Chapter 9 Recipe 2
 * Author: Wang Rui wangray84 at gmail dot com
*/

#include QtCore/QtCore
#include QtGui/QtGui
#include osgDB/ReadFile
#include osgGA/TrackballManipulator
#include osgViewer/ViewerEventHandlers
#include osgViewer/Viewer
#include osgQt/GraphicsWindowQt


osg::Camera* createCamera( int x, int y, int w, int h )
{
osg::DisplaySettings* ds = osg::DisplaySettings::instance().get();
osg::ref_ptrosg::GraphicsContext::Traits traits = new 
osg::GraphicsContext::Traits;
traits-windowDecoration = false;
traits-x = x;
traits-y = y;
traits-width = w;
traits-height = h;
traits-doubleBuffer = true;

osg::ref_ptrosg::Camera camera = new osg::Camera;
camera-setGraphicsContext( new osgQt::GraphicsWindowQt(traits.get()) );
camera-setClearColor( osg::Vec4(0.2, 0.2, 0.6, 1.0) );
camera-setViewport( new osg::Viewport(0, 0, traits-width, traits-height) 
);
camera-setProjectionMatrixAsPerspective(
30.0f, 
static_castdouble(traits-width)/static_castdouble(traits-height), 1.0f, 
1.0f );
return camera.release();
}

class RenderThread : public QThread
{
public:
RenderThread() : QThread(), viewerPtr(0) {}

virtual ~RenderThread()
{ if (viewerPtr) viewerPtr-setDone(true); wait(); }

osgViewer::Viewer* viewerPtr;

protected:
   virtual void run() { if (viewerPtr) viewerPtr-run(); }
};

class ViewerWidget : public QWidget
{
public:
ViewerWidget( osg::Camera* camera, osg::Node* scene )
:   QWidget()
{
_viewer.setCamera( camera );
_viewer.setSceneData( scene );
_viewer.addEventHandler( new osgViewer::StatsHandler );
_viewer.setCameraManipulator( new osgGA::TrackballManipulator );
_viewer.setThreadingModel( osgViewer::Viewer::SingleThreaded );

osgQt::GraphicsWindowQt* gw = dynamic_castosgQt::GraphicsWindowQt*( 
camera-getGraphicsContext() );
if ( gw )
{
QVBoxLayout* layout = new QVBoxLayout;
layout-addWidget( gw-getGLWidget() );
setLayout( layout );
}

_thread.viewerPtr = _viewer;
_thread.start();
}

protected:
osgViewer::Viewer _viewer;
RenderThread _thread;
};

int main( int argc, char** argv )
{
QApplication app( argc, argv );
osg::Camera* camera = createCamera( 50, 50, 640, 480 );
//osg::Node* scene = 
osgDB::readNodeFile(C:/datosVSS/modelos/base.obj);
osg::Node* scene = osgDB::readNodeFile(cow.osg);

ViewerWidget* widget = new ViewerWidget(camera, scene);
widget-setGeometry( 100, 100, 800, 600 );
widget-show();
return app.exec();
}
_


Thank you!

Cheers,
Francisco

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=49899#49899





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] New Osg Models

2012-09-17 Thread Theuns Heydenrych
Hi,
How do you build new osg models?
And how do you edit the existing models?

Thank you!

Cheers,
Theuns

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=50039#50039





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] [forum] osgWidget in 3D scene

2012-09-17 Thread Dagi Geister
Hi,

I have a problem with the rendering of the text on a osgWidget::Label. I have 
attached an osgWidget to a PositionAttitudeTransform and positioned it in a 3D 
scene. The Label is always rotated to the screen and has a fixed size. The 
problem occurs when changing the view on the scene (zoom in/out, rotating), 
then the text is flickering or is disappearing.

Any help would be appreciated very much :)



Code:

const unsigned int MASK_3D = 0x0F00;
osgWidget::WindowManager* wm = new osgWidget::WindowManager(this-getView(0), 
1280.0f,1024.0f,MASK_3D,osgWidget::WindowManager::WM_PICK_DEBUG );
wm-setPointerFocusMode(osgWidget::WindowManager::PFM_SLOPPY);
osgWidget::Box* box= new osgWidget::Box(HBOX,osgWidget::Box::HORIZONTAL 
,true);
box-getBackground()-setColor(0.6f, 0.6f, 0.6f, 0.8f);
box-setDataVariance(osg::Object::DYNAMIC);
QString labelText = Test;
osgWidget::Label* label1 = new osgWidget::Label(, );

label1-setFont(./data/fonts/arial.ttf);
label1-setFontSize(17);
label1-setFontColor(0.0f, 0.0f, 0.0f, 1.0f);
label1-setLabel(labelText.toStdString());
label1-setPadLeft(3.0f);
//State Set
box-getOrCreateStateSet()-setMode(GL_BLEND,osg::StateAttribute::ON);
label1-getOrCreateStateSet()-setMode(GL_BLEND,osg::StateAttribute::OFF);  
label1-getOrCreateStateSet()-setRenderingHint(osg::StateSet::TRANSPARENT_BIN);
label1-getOrCreateStateSet()-setMode( GL_DEPTH_TEST, 
osg::StateAttribute::OFF); label1-getOrCreateStateSet()-setMode( GL_DEPTH, 
osg::StateAttribute::OFF);
label1-setAlignHorizontal(osgWidget::Widget::HA_LEFT);
label1-setDimensions(0,0,130,60);
osg::StateSet* stateTest = label1-getOrCreateStateSet();

stateTest-setMode( GL_POLYGON_OFFSET_FILL,
osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE );
stateTest-setRenderBinDetails( 110, RenderBin,
osg::StateSet::OVERRIDE_RENDERBIN_DETAILS );
stateTest-setAttributeAndModes( new osg::ColorMask( false, false, false, false 
),
osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE );

stateTest-setAttribute( new osg::CullFace( osg::CullFace::FRONT ), 
osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE );

stateTest-setMode( GL_CULL_FACE, osg::StateAttribute::OFF );

box-setPosition(400,0,100);
box-addWidget(label1);

wm-addChild(box);

//Location of label
osg::AutoTransform* xform = new osg::AutoTransform;
xform-addChild(box-getGeode());
xform-setAutoRotateMode(osg::AutoTransform::ROTATE_TO_SCREEN);
xform-setAutoScaleToScreen(true);

osg::ref_ptrosgEarth::Util::ObjectLocatorNode  oln = new 
osgEarth::Util::ObjectLocatorNode(this-mapNode-getMap());
oln-getLocator()-setPosition(osg::Vec3d(4.763889,52.308613, 100.0));
oln-addChild(xform);

this-root-addChild(oln);





Thank you!

Cheers,
Alex

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=50046#50046





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] New Osg Models

2012-09-17 Thread Andreas Ekstrand

Hi Theuns,

One option is to use Remo 3D to build new OSG models and edit existing 
models. Have a look at www.remograph.com where you can download a fully 
functional evaluation version of Remo 3D.


Regards,
Andreas


On 2012-09-14 08:20, Theuns Heydenrych wrote:

Hi,
How do you build new osg models?
And how do you edit the existing models?

Thank you!

Cheers,
Theuns

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=50039#50039





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Mouse pointer hide

2012-09-17 Thread StarMessage
Hi,

How to set functions or parameters for hide the mouse pointer,
but the process still deal to mouse event handler.
I'm new osg tyro, I hope you to help me.

Thank you!

Cheers,
StarMessage

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=49783#49783





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Opinions: is OpenSceneGraph the right choice?

2012-09-17 Thread Randall Hand
Hi,

I've been programming in OpenGL for several years now, and I'm about to start a 
new project and thought OpenSG might be a good tool to use.  However, I'm 
integrating data from lots of outside sources (gyros, cameras, network, etc) so 
I can't just do a Viewer run() (looking at doing the Viewer frame() thing), 
but I'm also going to have lots of frequently changing geometry  camera 
information.  All the demos I see simply construct a Scenegraph once at program 
start, then do Viewer run().  Is it possible/advisable to have frequently 
changing scenegraphs with OpenSG (eg, new nodes, dying nodes, changing nodes, 
etc).

... 

Thank you!

Cheers,
Randall

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=49757#49757





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Multi-rendering per frame

2012-09-17 Thread Harry Li
Hi,

I have three pre-rendered render-to-texture cameras using frame-buffer-object 
to generate a final texture for me at each frame. It works fine, but now I want 
them to do the generation multiple times per frame, can you give me some hints?

I've tired the following methods but none of them works:
1. To allow the group of cameras have multiple parents which belong to the same 
root, so that the group of camera can be reused, but I'm afraid the calculation 
of different path may be carried out simultaneously. Anyway, the results is not 
as expected.

2. To use osg::Sequence to group these cameras and setup it like this:

Code:
seq-setInterval(osg::Sequence::LOOP, 0, -1);
seq-setNumRepeats(times_of_render_per_frame);


This also doesn't work out.

I was wondering whether it's due to the bugs in my code or simply I cannot use 
the osg in such a way.


... 

Thank you!

Cheers,
Harry
Code:




--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=49723#49723





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] PROTO nodes are not reading

2012-09-17 Thread Mahesh Manni
Hi,
I am using VRML 0.17.12 version API for importing the vrml files.

My importer is not reading the nodes that is declared under the PROTO keyword.

Earlier, I have used VRML 0.14.2 version, where it is reading perfectly all 
kinds of declarations.

Please somebody help me on this
... 

Thank you!

Cheers,
Mahesh

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=49712#49712





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [forum] How to use OSG on Hyperworks Rocks Cluster?

2012-09-17 Thread Kleber Jacome
Hi,
How to use OSG on Hyperworks Rocks Cluster with tool pirconfig, oficial page 
http://www.hiperworks.com/pirdoc/qstart-doc/ or to use OSG+CGLX on CentOs ?

I can to do this on Centos HyperWorks moderately, I see the OSG application 
only on the primary node (head node) and found perfect; but only I see an 
static image on the child node, the application is not complete due to this 
error.
Could you help me with some topics?

see more... Hyperworks: 
http://www.hiperworks.com/index.php/about-us/our-advantage

Thank you!

Cheers,
Mao

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=49695#49695





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] How to select or pick an object in OSG, in file .osg using osgviewer pick.osg?

2012-09-17 Thread Kleber Jacome
Hi,
I'm working on a project, could you help me? How to select or pick an object in 
OSG, in file '.osg' using osgviewer pick.osg?
... 

Thank you!

Cheers,
Mao

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=49692#49692





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Memory leak notify handler

2012-09-17 Thread Tassilo Glander
OSG uses smart pointers to manage memory (and release it if the last pointer is 
destroyed). The handler created with new in your cited code is stored in a 
smart pointer variable (see Notify.cpp)
osg::ref_ptrosg::NotifyHandler _handler;
(if the cast is a NotifyStreamBuffer). So I guess a memory leak could occur, if 
a StreamBuffer different than NotifyStreamBuffer is used.

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=50090#50090





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Open GL ES 3.0

2012-09-17 Thread Katja Oechnser
Hi everyone,

the specification of Open GL ES 3.0 has been released. So  I wonder if anyone 
is planning to integrate it into osg? 
As far as i know it is compatible to OpenGL ES 2.0, but there are some more 
features. For example would it be interesting if the new texture-compression 
formats (ETC2/EAC and ASTC) will be supported in future (they are also part of 
OpenGL 4.3). 

Does anyone plans something or has an idea how complex it is to do this 
integration? I think it shouldn't be that hard because OGL ES is getting closer 
to OpenGL...

Thank you!

Cheers,
Katja

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=49687#49687





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Camera manipulator velocity and home() calculation affected after scaling nodes

2012-09-17 Thread Regina Howard
You can find it from the settings.

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=49674#49674





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Self-Shadowing of Billboards

2012-09-17 Thread Regina Howard
Billboards present large advertisements to passing pedestrians and drivers. 
Today it is estimated that the average individual is bombarded with more than 
5,000 advertisements every single day. With such an overabundance of 
advertising, people have begun to mentally tune out advertising that they 
consider clutter. That means that in order to get your message across to your 
intended audience you have to really do something to make it stand out from the 
competition (http://www.emeraldoutdoor.com/). Outdoor advertising reaches its 
audience as an element of the environment.  Unlike newspaper, radio or TV, it 
doesn't have to be invited into the home.  And it doesn't provide entertainment 
to sustain its audience.

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=49673#49673




Attachments: 
http://forum.openscenegraph.org//files/billboard_737.jpg


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Best way of adding more models?

2012-09-17 Thread Regina Howard
Cool. I'll try it. Looks like fun to add models. :)

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=49670#49670





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OSG Serialization - changes on custom Classes

2012-09-17 Thread Regina Howard
Interesting. The mechanism is nice and fits it.

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=49672#49672





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] [3rdparty] Compiling GDAL with HDF4-support

2012-09-17 Thread David Leimbach
I need GDAL with both Shapefile and HDF4-Support, if possible in 64 bit. 
Since the normal GDAL-versions from (gisinternalscom) have Shapefile, but no 
HDF4 and the version from FWTools
has HDF4, but no Shapefiles, Im afraid I have to compile a GDAL-version by 
myself.
The problem is that Im 'just' a geographer with programming skills, but no real 
IT-expert, and Ive never compiled open source by myself,
so maybe my question is quite simple for you. :)

First Ive downloaded the source code from (tracosgeoorg). 
The I opened makegdal90.vcproj with Visual Studio 2010. It needed to do some 
updates, then it opened.
If I compile it without changes, I get a GDAL-folder with a new GDAL19.dll. 
If I try to use this whole folder in my C#-project that works with normal 
GDAL-versions, I get a error.
But if I only copy the new GDAL19.dll over the old one in the existing GDAL(32 
bit)-folder it works.
Is this how it should be or is something going wrong here already ?

The second step is to switch to 64bit, in nmake.opt I changed the following 
entry:
# Uncomment the following if you are building for 64-bit windows
# (x64). You'll need to have PATH, INCLUDE and LIB set up for 64-bit
# compiles.
WIN64=YES
Then I changed the setting of the VS-project to X64 and compiled again.
It still works as before: I get a new GDAL19.dll that works fine in my old 
GDAL(64 bit)-folder.

But then I cant do the third step, including HDF4. I found and changed the 
following section in nmake.opt:
# Uncomment the following and update to enable NCSA HDF Release 4 support.
HDF4_PLUGIN = NO
HDF4_DIR =  C:\HDF
HDF4_LIB =  /LIBPATH:$(HDF4_DIR)\lib Ws2_32.lib
I tried it maybe 100 times, but it never worked. Sometimes I get a corrupt 
GDAL19.dll, sometimes I get 100 errors when compiling
and sometimes I get a working GDAL19.dll without HDF4-support. I've read almost 
every Google-hit in English and German I found,
but it never worked. One problem is that the files mentioned there do not exist 
in the HDF-versions Ive downloaded. I guess, this
tips were for much older versions of GDAL and HDF4.

So can anybody give a step by step tutorial How to compile GDAL with HDF4 for 
dummies ? ;)
I need to know which HDF4-files I need, where to get them, and what exactly I 
have to write in nmake.opt.
Or is there a ready to use GDAL-download with HDF4 and Shapefiles somewhere ?
(32 bit would be OK to, that isnt that important)

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=49606#49606





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Top 10 OSG Debugging Tips

2012-09-17 Thread robert pattinson
That's a good point, I forgot all about this. In fact, I'm not sure I even saw 
the link posted.

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=49548#49548





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] [osgPlugins] [ive] Option inlineExternalReferencesInIVEFile

2012-09-17 Thread martin s
Hi,

in ive-Plugin option string inlineExternalReferencesInIVEFile is used instead 
of option includeExternalReferences. Why is this?
Should be harmonized in all plugin code.

Thank you!

Cheers,
martin

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=49537#49537





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] [vpb] error in building vpb

2012-09-17 Thread Gowtam Maligireddy
Hi,

I am new to OSG. I am trying to build vpb-0.9.12 with OSG-2.9.9 and gdal-1.9. I 
am getting following errors:
please help me out.


 Creating library E:\VPBbuild\VirtualPlanetBuilder_build\lib\Release\vpb.lib 
and object E:\VPBbuild\VirtualPlanetBuilder_build\lib\Release\vpb.exp
1TaskManager.obj : error LNK2001: unresolved external symbol public: virtual 
void __thiscall osg::Object::setThreadSafeRefUnref(bool) 
(?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
1ThreadPool.obj : error LNK2001: unresolved external symbol public: virtual 
void __thiscall osg::Object::setThreadSafeRefUnref(bool) 
(?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
1SpatialProperties.obj : error LNK2001: unresolved external symbol public: 
virtual void __thiscall osg::Object::setThreadSafeRefUnref(bool) 
(?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
1System.obj : error LNK2001: unresolved external symbol public: virtual void 
__thiscall osg::Object::setThreadSafeRefUnref(bool) 
(?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
1TextureUtils.obj : error LNK2001: unresolved external symbol public: virtual 
void __thiscall osg::Object::setThreadSafeRefUnref(bool) 
(?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
1Task.obj : error LNK2001: unresolved external symbol public: virtual void 
__thiscall osg::Object::setThreadSafeRefUnref(bool) 
(?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
1ObjectPlacer.obj : error LNK2001: unresolved external symbol public: virtual 
void __thiscall osg::Object::setThreadSafeRefUnref(bool) 
(?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
1ShapeFilePlacer.obj : error LNK2001: unresolved external symbol public: 
virtual void __thiscall osg::Object::setThreadSafeRefUnref(bool) 
(?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
1Source.obj : error LNK2001: unresolved external symbol public: virtual void 
__thiscall osg::Object::setThreadSafeRefUnref(bool) 
(?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
1SourceData.obj : error LNK2001: unresolved external symbol public: virtual 
void __thiscall osg::Object::setThreadSafeRefUnref(bool) 
(?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
1FileUtils.obj : error LNK2001: unresolved external symbol public: virtual 
void __thiscall osg::Object::setThreadSafeRefUnref(bool) 
(?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
1GeospatialDataset.obj : error LNK2001: unresolved external symbol public: 
virtual void __thiscall osg::Object::setThreadSafeRefUnref(bool) 
(?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
1HeightFieldMapper.obj : error LNK2001: unresolved external symbol public: 
virtual void __thiscall osg::Object::setThreadSafeRefUnref(bool) 
(?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
1MachinePool.obj : error LNK2001: unresolved external symbol public: virtual 
void __thiscall osg::Object::setThreadSafeRefUnref(bool) 
(?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
1Destination.obj : error LNK2001: unresolved external symbol public: virtual 
void __thiscall osg::Object::setThreadSafeRefUnref(bool) 
(?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
1ExtrudeVisitor.obj : error LNK2001: unresolved external symbol public: 
virtual void __thiscall osg::Object::setThreadSafeRefUnref(bool) 
(?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
1FileCache.obj : error LNK2001: unresolved external symbol public: virtual 
void __thiscall osg::Object::setThreadSafeRefUnref(bool) 
(?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
1FileDetails.obj : error LNK2001: unresolved external symbol public: virtual 
void __thiscall osg::Object::setThreadSafeRefUnref(bool) 
(?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
1Commandline.obj : error LNK2001: unresolved external symbol public: virtual 
void __thiscall osg::Object::setThreadSafeRefUnref(bool) 
(?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
1DatabaseBuilder.obj : error LNK2001: unresolved external symbol public: 
virtual void __thiscall osg::Object::setThreadSafeRefUnref(bool) 
(?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
1DatabaseBuilderIO.obj : error LNK2001: unresolved external symbol public: 
virtual void __thiscall osg::Object::setThreadSafeRefUnref(bool) 
(?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
1DataSet.obj : error LNK2001: unresolved external symbol public: virtual void 
__thiscall osg::Object::setThreadSafeRefUnref(bool) 
(?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
1BuildLog.obj : error LNK2001: unresolved external symbol public: virtual 
void __thiscall osg::Object::setThreadSafeRefUnref(bool) 
(?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
1BuildOperation.obj : error LNK2001: unresolved external symbol public: 
virtual void __thiscall osg::Object::setThreadSafeRefUnref(bool) 
(?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
1BuildOptions.obj : error LNK2019: unresolved external symbol public: virtual 
void __thiscall osg::Object::setThreadSafeRefUnref(bool) 
(?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z) referenced in function public: 
void __thiscall vpb::BuildOptions::setNotifyLevel(class 
std::basic_stringchar,struct std::char_traitschar,class 

Re: [osg-users] Cannot add dragger to group node

2012-09-17 Thread Oliver Neubauer
Hi Robert,

it was my stupid mistake, I included both normal and debug osgManipulator 
library file. Couldnt find how to delete this topic, so it stayed here till it 
was approved.
Thanks for the reply anyway, and sorry for such stupid question.
The crash message stated Access violation writing location 0xcdcdcdcd, which 
what I found talks about uninitialized variable, that made me wonder even more.

Oliver.

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=49519#49519





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [3rdparty] osg and collada

2012-09-17 Thread Nikos Patsiouras
Hi,
I have this fully rigged and skinned character with a bit of animation in Maya 
2011 that i want to export to collada and load up in osgAnimation/osgViewer and 
confirm all is well.
So far animation seems to be exported ok since i can import with openCOLLADA 
import plugin the .dae created and the animation is there.

But I have two problems related to geometry.My character has 6 main shapes and 
there are 5 more for the eyeballs the teeth and the 
tongue.Face,Torso,Left_Arm,Right_Arm,Accessories(belt,belt loops,pocket flaps) 
and Legs(pants without the above and the shoes).
1)when i import to Maya with openCOLLADA importer the .dae file the shape of 
the Legs is missing when the Accessories shape is there.the joints are 
there,the animation too.Also the texture are a bit weird.
(MayaImporter attachment)

2)if i load the same .dae in osgViewer i get all shapes except the Face.
the Legs shape is there contrary to the 1st case.Eyeballs,teeth,tongue are 
there too.the only thing missing is the Face shape.
(osgViewer attachment)

the output in the console before osgViewer comes up,when loading textures and 
stuff is attachments osgViewer_output 12


I also don't get any log with warnings or errors in Maya when i try to export.


as far as the 1st case goes i tried to export to dae just the Legs part and the 
joint chain having removed the joints from the waist up and when I made a new 
scene and imported the dae the Legs shape loaded fine.I suspect there is some 
problem between the Legs shape and all the rest.

if anyone can help it would be much appreciated.i've got till the 31st to turn 
in the results.


Thank you!

Cheers,
Nikos



EDIT1:i tried to reconstruct the file i was trying to export from without 
binding.Just the geometry the textures the joints and some animation for the 
joints.It loaded correctly in Maya from the dae.And the osgViewer loads 
everything.the only thing not working in both is the textures.would a faulty UV 
mapping be the problem?i haven't touched it in Maya but from what I've seen 
it's wrong.but Maya has been loading them correctly so I didn't bother(not my 
expertise either,no time too)

EDIT2:i bound the new skeleton and geometry parts but a bit differently and 
everything loads(textures are off again) but all geometry 
parts,animation,joints,all load.Previously i had done selective binding.for 
example the arm had only those joints it needed from the shoulder onwards and 
another one at the clavicle.now i just selected all geometry parts and the Root 
joint and did a smooth bind with one bind pose(as opposed to my other file) and 
on the whole joint chain not selected joints.
it's either selective binding or multiple bind poses that cause the problems

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=49482#49482




Attachments: 
http://forum.openscenegraph.org//files/osgviewer_output2_109.jpg
http://forum.openscenegraph.org//files/osgviewer_output1_328.jpg
http://forum.openscenegraph.org//files/osgviewer_381.jpg
http://forum.openscenegraph.org//files/mayaimporter_184.jpg


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [osgPlugins] statically linking osgPlugins for Android [SOLVED]

2012-09-17 Thread James Cotton
I managed to get OSG compiled without issue for Android and incorporate it into 
my application.  However, the models I would like to use are .3DS and I'm 
trying to get the 3ds plugin used.  It was disabled in the build process, but 
was reenable without much issue.

However, I don't know how to tie it into my application.  Currently the Android 
toolchain builds OSG statically but when I enable debugging messages the code 
is still looking for .so plugins. This is also an issue for the texture files 
(osgdb_imageio.so). So I have two questions for possible solutions:

1) is there a way to make things that currently use plugins use statically 
linked code?  Like an alternative registration to permanently register those 
plugins at init and make sure the code gets linked in?
2) if not, can anyone suggest how to make the plugins build as a .so and the 
core code to build as a static library (for Android).

Or any other approaches you guys can suggest.

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=49415#49415





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [osgPlugins] statically linking osgPlugins for Android

2012-09-17 Thread James Cotton
So after tweaking the CMakeList.txt for the plugins I have png/jpeg's going to 
their appropriate plugins statically linked.  However, I'm still not seeing 
textures.  I get these warnings:


Code:

08-23 11:11:31.532: I/Osg Viewer(3689): OpenGL extension 
'GL_EXT_texture_filter_anisotropic' is supported.
08-23 11:11:31.532: I/Osg Viewer(3689): OpenGL extension 
'GL_EXT_texture_compression_s3tc' is supported.
08-23 11:11:31.532: I/Osg Viewer(3689): OpenGL extension 
'GL_IMG_texture_compression_pvrtc' is not supported.
08-23 11:11:31.532: I/Osg Viewer(3689): OpenGL extension 
'GL_OES_compressed_ETC1_RGB8_texture' is supported.
08-23 11:11:31.532: I/Osg Viewer(3689): OpenGL extension 
'GL_EXT_texture_compression_rgtc' is not supported.
08-23 11:11:31.532: I/Osg Viewer(3689): OpenGL extension 
'GL_IMG_texture_compression_pvrtc' is not supported.
08-23 11:11:31.532: I/Osg Viewer(3689): OpenGL extension 
'GL_ARB_texture_multisample' is not supported.
08-23 11:11:31.542: I/Osg Viewer(3689): OpenGL extension 'GL_ARB_shadow' is not 
supported.
08-23 11:11:31.542: I/Osg Viewer(3689): OpenGL extension 
'GL_ARB_shadow_ambient' is not supported.
08-23 11:11:31.542: I/Osg Viewer(3689): OpenGL extension 
'GL_APPLE_client_storage' is not supported.
08-23 11:11:31.542: I/Osg Viewer(3689): OpenGL extension 
'GL_EXT_texture_integer' is not supported.
08-23 11:11:31.542: I/Osg Viewer(3689): Created new 0x650ec8a0 TextureObject, 
_numOfTextureObjects 1
08-23 11:11:31.542: I/Osg Viewer(3689): Scaling image 
'/storage/sdcard0/Models/TEXTURE.PNG' from (350,50) to (256,64)
08-23 11:11:31.552: I/Osg Viewer(3689): OpenGL extension 
'GL_EXT_packed_depth_stencil' is not supported.
08-23 11:11:31.552: I/Osg Viewer(3689): Created new 0x66d90bc0 TextureObject, 
_numOfTextureObjects 1
08-23 11:11:31.552: I/Osg Viewer(3689): Scaling image 
'/storage/sdcard0/Models/CC.PNG' from (788,393) to (1024,512)
08-23 11:11:31.882: I/Osg Viewer(3689): OpenGL extension '' is not supported.
08-23 11:11:31.882: I/Osg Viewer(3689): Setting up osg::Camera::FRAME_BUFFER
08-23 11:11:31.882: I/Osg Viewer(3689): Warning: Material::apply(State) - not 
supported.
08-23 11:11:31.952: I/Osg Viewer(3689): Warning: Material::apply(State) - not 
supported.
08-23 11:11:31.952: I/Osg Viewer(3689): Warning: Material::apply(State) - not 
supported.
08-23 11:11:31.952: W/Osg Viewer(3689): Warning: detected OpenGL error 'invalid 
enumerant' at after RenderBin::draw(..)
08-23 11:11:31.952: D/Osg Viewer(3689): end cull_draw() 0x652b7670




I know I saw some other threads about textures and android but I'm a bit out of 
my depth here so if anyone could point me in the right direction...  Sorry for 
taking my own thread OT.

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=49472#49472





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [osgPlugins] statically linking osgPlugins for Android

2012-09-17 Thread James Cotton
Great, thank you very much.  That fixed it!  

Edit: At the risk of derailing my own thread, the plugin then tries to find 
imageio to load the textures, but that isn't available on android (and looks 
like it's designed to be apple specific).  What plugin should I be looking at?

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=49458#49458





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Using OSG Embedded in an Existing OpenGL Project

2012-09-17 Thread Sergey Polischuk
Hi

You could use graphics context\window created by another means (that what 
osg::GraphicsWindowEmbedded does), but you still should create osgviewer and 
stuff. You can check various osgviewer*** examples in osg source tree in 
examples directory.

Cheers.

09.09.2012, 03:24, Dainon Woudstra dain...@gmail.com:
 Hi,

 Background:
 I've written an application in C# for various reasons. SharpGL provided the 
 OpenGL portion, C# provided the Database, and Intellisense works with it in 
 VS 2010. I've rewritten this application in 3 different frameworks and have 
 hit issues I could not solve for one reason or another. For example, now that 
 my application works and I use it everyday, I'm trying to enhance some of its 
 features, such as loading a 3D object and good text rendering.

 I've come across OpenSceneGraph and have been trying to use it with the C# 
 wrappers. I couldn't get that working and read a bunch of posts providing 
 other solutions and mentioning it isn't supported anymore. Thus, I've learned 
 to write a wrapper for a C++ OSG DLL to call some native OSG functions.

 It works great, except that it doesn't, LOL. The code it fine, I've tested it 
 in a sample, non C# application using the viewer and all.

 The Question:
 The part that I don't understand is how to use OSG to render in an existing 
 OpenGL viewport. Is there a way to attach to the existing OpenGL instead of 
 creating the OSG viewer as noted in every OSG example I've seen?

 C# SharpGL initialization

 Code:

 // Initialize SharpGL
 void initSharpGL() {
    openGLControl = new SharpGL.OpenGLControl();
    ((System.ComponentModel.ISupportInitialize)(openGLControl)).BeginInit();

    //
    // openGLControl
    //
    openGLControl.BitDepth = 32;
    openGLControl.Dock = System.Windows.Forms.DockStyle.Fill;
    openGLControl.DrawFPS = true;
    openGLControl.FrameRate = 60;
    openGLControl.Location = new System.Drawing.Point(0, 0);
    openGLControl.Name = openGLControl;
    openGLControl.RenderContextType = SharpGL.RenderContextType.FBO;
    openGLControl.Size = new System.Drawing.Size(1680, 1060);
    openGLControl.TabIndex = 0;
    openGLControl.OpenGLInitialized += new 
 System.EventHandler(openGLControl_OpenGLInitialized);
    openGLControl.OpenGLDraw += new 
 System.Windows.Forms.PaintEventHandler(openGLControl_OpenGLDraw);
    openGLControl.Resized += new System.EventHandler(openGLControl_Resized);
    openGLControl.Click += new System.EventHandler(OpenGL_Click);
    ((System.ComponentModel.ISupportInitialize)(openGLControl)).EndInit();
    Controls.Add(openGLControl);

    ...
 }

 Native OSG Code:

 Code:

 // Create the scene root
 mRoot = new osg::Group;

 // The viewer
 mViewer = new osgViewer::Viewer;
 mWindow = mViewer-setUpViewerAsEmbeddedInWindow(0, 0, 1680, 998);
 mViewer-getCamera()-setClearMask(0);
 mViewer-setSceneData(mRoot);
 mViewer-realize();

 osg::ref_ptrosg::Geode geode = new osg::Geode;

 std::string fontFile(arial.ttf);
 font = osgText::readFontFile(fontFile);
 if (font.valid()) {

    osgText::Text* text = new osgText::Text;
    if (text != 0) {
   text-setFont(font);
   text-setColor(osg::Vec4(0.0f, 1.0f, 1.0f, 1.0f));
   text-setCharacterSize(40.0f);
   text-setPosition(osg::Vec3(100.0f, 100.0f, 0.0f));
   text-setText(SomeSome!);

   text-setLayout(osgText::Text::LEFT_TO_RIGHT);

   geode-addDrawable(text);
    }
 }

 mRoot-addChild(geode);

 The OSG Draw Callback function contents

 Code:

 mViewer-frame();

 Thank you!

 Cheers,
 Dainon

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=49871#49871

 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Is there something like an optimal way for integrating physics?

2012-09-17 Thread Sergey Polischuk
Hi

i've used bullet integrated through callbacks. works fine most of the time, but 
there are some problems wrt vehicle simulation (like ground should be rather 
fine tesselated if you use static mesh for ground and sometimes there are 
erroneous collisions with internal edges of ground mesh but latter can be 
already fixed in bullet, as i dont checked this stuff for like 2 years or so 
and it was known issue).

Cheers.

15.09.2012, 13:16, funk menera funkmemail-...@yahoo.de:
 Hi,

 propably the answer depends on what is to be done with physics. (and has been 
 discussed before?)

 But i'm curious if someone can post his/her experiences with OSG and 
 physics-integrations concerning performance differences.

 Well, up to now i only tried PhysX ... and my answer rised because i found 
 three ways for integrating PhysX:
 - callback
 - GUIEventAdapter
 - node-integration
 There might be more ...

 Finally, let me say that i wanna do something in the direction of vehicle 
 dynamics.
 First using the 'pre-defined models', but afterwards maybe creating a more 
 sophisticated model.
 So i'm pretty sure, that i could use any physics engine ... maybe Bullet is 
 better to be integrated into OSG than PhysX? Or the way round? Or Havok is 
 faster?

 Basically, i'm just wondering if there are 'notable' differences in 
 performance concerning the different physics-SDKs and their ways of 
 integration? (Especially in terms of vehicle dynamics)

 Thank you very much!

 Cheers,
 funk

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=50073#50073

 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Depth buffer questions

2012-09-17 Thread Sergey Polischuk
Hi

to compute depth from z-buffer depth you should use:

depth = -gl_ProjectionMatrix[3].z/(zb_depth * (-2.0) + 1.0 - 
gl_ProjectionMatrix[2].z)

where:
gl_ProjectionMatrix[3].z = - 2*far*near / (far - near)
gl_ProjectionMatrix[2].z = - (far + near) / (far - near)

Cheers.

14.09.2012, 00:49, Andrey Shvartsman ashvarts...@dcscorp.com:
 Hello,

 I am trying to read real distance from a depth buffer from a scene, and I 
 have a couple of questions. I am using Wang Rui's code as a starting point 
 for working with depth buffers (specifically his code from the OpenSceneGraph 
 Cookbook Chapter 6, Recipe 4).

 What I am trying to do is to read the distance from the depth buffer and dump 
 it to standard output as a start. I've attached an osg::Image to the viewer's 
 camera's depth buffer, and I am querying the image values during a click 
 event in a pick handler (the reason for the pick handler is I would like to 
 eventually do a comparison of the distance value I get from using an 
 Intersector vs the value from the depth buffer).

 Code:

 viewer.getCamera()-attach(osg::Camera::DEPTH_BUFFER,image);

 image-allocateImage(32,32,1,GL_DEPTH_COMPONENT,GL_FLOAT);

 So I am using a 32x32 image, and I am querying the image value with:

 Code:

 for(int k=0; k32; k++)
 {
 for(int l=0; l32; l++)
 {
 z_buffer=((float*)image-data(k,l))[0];
 z=-1/(z_buffer-1);
 std::cout z  ;
 }
 std::coutstd::endl;
 }

 I understand that the z-buffer distance is not linear, so following the 
 article Love your Z-Buffer by Steve Baker (can't post links yet because I 
 don't have enough posts) I came up with the formula z=-1/(z_buffer-1) for 
 converting a z_buffer value to an approximate real distance value for a 24 
 bit depth buffer, with zNear at 1m, and zFar at 10,000m

 However the values I am getting when querying the resulting image don't make 
 a lot of sense to me. When I am standing on my terrain in first-person mode, 
 visually I see the top half of my screen filled with the sky, and the bottom 
 half with the terrain, so I would expect to have very large distance values 
 for the top portion of the depth buffer image, and smaller and smaller values 
 as I get closer to the bottom. However all of the values in the 32x32 depth 
 image are around 2m.

 I would really appreciate it if someone could take a look at the code and let 
 me know where I am going wrong.

 Eventually, I would like to render the depth buffer as a grayscale image akin 
 to what you would see from a ranging sensor such as a lidar or a Kinect. Is 
 this even a good approach to do this kind of visualization or am I better of 
 trying some sort of a ray-tracing solution? My only concern with ray-tracing 
 is that I need to maintain soft real-time performance, and I am not sure 
 that I can achieve that using a ray-tracing solution. I would appreciate any 
 advise.

 Thank you!

 Andrey

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=50031#50031

 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Mouse pointer hide

2012-09-17 Thread Sergey Polischuk
Hi

osgViewer::Viewer::Windows sWindows;
viewer.getWindows(sWindows);
//for each window -
window-setCursor(osgViewer::GraphicsWindow::NoCursor);

Cheers

05.09.2012, 20:04, StarMessage huangbe...@vip.qq.com:
 Hi,

 How to set functions or parameters for hide the mouse pointer,
 but the process still deal to mouse event handler.
 I'm new osg tyro, I hope you to help me.

 Thank you!

 Cheers,
 StarMessage

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=49783#49783

 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Opinions: is OpenSceneGraph the right choice?

2012-09-17 Thread Alberto Luaces
Hi Randall,

Randall Hand writes:

 Hi,

 I've been programming in OpenGL for several years now, and I'm about
 to start a new project and thought OpenSG might be a good tool to use.

Be careful, OpenSG is a different project than OpenSceneGraph.

 
 However, I'm integrating data from lots of outside sources (gyros,
 cameras, network, etc) so I can't just do a Viewer run() (looking at
 doing the Viewer frame() thing), but I'm also going to have lots of
 frequently changing geometry  camera information.  All the demos I
 see simply construct a Scenegraph once at program start, then do
 Viewer run().  Is it possible/advisable to have frequently changing
 scenegraphs with OpenSG (eg, new nodes, dying nodes, changing nodes,
 etc).

Yes, you can make your own loop through frame().  An example can be
found at src/ViewerBase.cpp implementation of the run() method.  You can
change your graph between frame() calls, or use node callbacks for the
same purpose.  Just remember to mark changing nodes as DYNAMIC with
setDataVariance() in order for the OSG threads not modifying/reading
those nodes simultaneously.

-- 
Alberto

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] How to select or pick an object in OSG, in file .osg using osgviewer pick.osg?

2012-09-17 Thread Alberto Luaces
Kleber Jacome writes:

 Hi,
 I'm working on a project, could you help me? How to select or pick an object 
 in OSG, in file '.osg' using osgviewer pick.osg?
 ... 

Hi, please take a look at the 'osgpick' example in OSG.

-- 
Alberto

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Qt and OpenThreads

2012-09-17 Thread Nico Kruithof
Hi,

OpenGL rendering with Qt is kind of tricky. Qt wants to render from the
main thread, while OSG performs much better with threading enabled. We have
a working application with OSG 3.0.1, but it doesn't work anymore with OSG
3.1.2. I still need to investigate that. Qt also has improved OpenGL
rendering from a different thread in Qt 4.8, so that might be worth
investigating as well.

I did a google search on the topic a while ago and collected usefull
information:
http://web.nghk.nl/things-to-remember/qtandmultithreadedopenglrendering

Bests,
Nico


On Fri, Sep 14, 2012 at 11:59 AM, Max Sergeev sergeev.m...@gmail.comwrote:

 Hello!

 I'm stuck on one problem.

 There is kind of big project, and I need to make Qt interface on it. What
 I try to do is make a camera for Qt-interface element. The problem comes
 with using OpenThreads: I'm trying to run OSG rendering inside new thread,
 yielding to rendering of Qt element, like in osgQtBrowser example.
 First, I create class to handle thread creating:

 Code:

 class ViewerFrameThread : public OpenThreads::Thread
 {
 public:

 ViewerFrameThread(osgViewer::ViewerBase* viewerBase, bool
 doQApplicationExit):
 _viewerBase(viewerBase),
 _doQApplicationExit(doQApplicationExit) {}

 ~ViewerFrameThread()
 {
 cancel();
 while(isRunning())
 {
 OpenThreads::Thread::YieldCurrentThread();
 }
 }

 int cancel()
 {
 _viewerBase-setDone(true);
 return 0;
 }

 void run()
 {
 int result = _viewerBase-run();

 if (_doQApplicationExit) QApplication::exit(result);
 }

 osg::ref_ptrosgViewer::ViewerBase _viewerBase;
 bool _doQApplicationExit;
 };




 Then I try to run my viewer using it:


 Code:

 ViewerFrameThread frameThread(m_viewer.getViewerBase());
 frameThread.startThread();
 return QApplication::exec();




 And here comes problem: if I use frameThread.startThread() like in
 example, my project gives me access violation, like every try in new place.
 Otherwise, if I use frameThread.run(), everything runs OK but Qt button
 isnt getting rendered (just a white block in the corner of the screen)

 I've tried to make a simply application with just model and Qt-button, and
 everything works fine with .startThread(), as button doesnt get rendered
 with .run() same as in my big project. Could not find any documentation
 of OpenThreads. :(

 So the question is, like: is it possible to render Qt thingy with
 .run(), or what can possibly cause Access Violation with .startThread()?

 I'm sorry if the explanation wasnt very clear, though hopefully someone
 can help :)
 Thanks in advance!

 Cheers,
 Max

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=50049#50049





 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




-- 
Nico Kruithof
nghk.nl
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Memory leak notify handler

2012-09-17 Thread Robert Osfield
Hi Markus,

VS is known to report false positives due to issues of destruction
order, i.e. it can report errors of objects that haven't been
destructed yet but will be.

Put a break point in your NotifyHandler destructor to see if it's
being called on exit.

Robert.

On 23 August 2012 13:57, Markus Hochstrasser markus.hochstras...@gmx.de wrote:
 Hi,

 I'm new here, and quite new in the OSG world :)

 I use Visual Studio 2008 with Visual Leak Detector to dump memory leaks.  I 
 tried to rebuild an example from OpenSceneGraph Beginners Guide - page 58 
 to redirect the OSG notify stream as follows. Unfortunately Visual Leak 
 Detector indicates a memory leak (new LogFileHandler...) - so I wonder if 
 this really a leak or just a false positive? Actually I cannot see the 
 error...


 osg::setNotifyLevel( osg::INFO );
 osg::setNotifyHandler( new LogFileHandler(output.txt) ); -- the 
 potential leak

 (Sorry I wanted to post the full code, but I get an error like you need at 
 least 2 posts to include links/urls even if my code doesn't include any urls)

 Thank your very much!

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=49450#49450





 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Hello All

2012-09-17 Thread Robert Osfield
On 16 September 2012 14:06, Ryan Ron ryan.ro...@yahoo.com wrote:
 I am Newbie here.. Just want to say hello all of you..

Hello and welcome ;-)
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] How to draw a simple frustum wireframe cube?

2012-09-17 Thread Robert Osfield
Hi Charama??

Perhaps the osgthirdpersonview example
(OpenSceneGraph/examples/osgthirdpersonview/osgthirdpersonview.cpp)
would be appropriate as this creates a third personal view of the main
interactive view with the third person view showing the view frustum
on the main view as a wireframe.

Robert.



On 14 September 2012 10:36, Charma Man motoko_kusan...@web.de wrote:
 Hello Forum,

 I am an absolute osg-beginner. I am currently working on a very huge project 
 which is using osg. I now would like to draw something in the existing scene 
 without messing everything up. I will try to give you as much detail as I can 
 to make it easier to understand.

 I have access to a callback-function which is called before every frame 
 drawing. Also I have access to the two matices


 Code:
 this-rootTransform = opencover::cover-getObjectsXform()-getMatrix();

 // Get camera frustum parameters
 osg::Matrix matProj = 
 opencover::coVRConfig::instance()-screens[0].camera-getProjectionMatrix();

 matProj.getFrustum(
 this-frustum.left,
 this-frustum.right,
 this-frustum.bottom,
 this-frustum.top,
 this-frustum.znear,
 this-frustum.zfar
 );




 As you probably see the call opencover::coVRConfig::instance() also returns 
 the instance. What I would like to do now is draw some simple lines (as in 
 like glBegin) but in screen coordinates, so with positions in the frustum 
 corners like (1,1,1) or (1,-1,-1).

 The reason for this is that I want to make the whole frustum visible 
 because I am using a stereoscopic VR-renderer and I want to validiate how big 
 the frustum is and when do you step into the 3D scene.

 I hope anyone can help me with this and can provide some simple sample code. 
 If you need more detail, feel free to ask back.

 Thank you!

 Cheers,
 Charma

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=50045#50045





 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [build] Error Building OSG3.1.1 on linux in ReaderWriterJP2

2012-09-17 Thread Robert Osfield
Hi Benjamin,

It looks like the Jasper headers have changed, have a look at the docs
on Jasper to see if they have removed particular headers in recent
releases.

Robert.

On 12 September 2012 00:09, benjamin bish benc...@comcast.net wrote:
 Hi,
I'm trying to build OSG 3.1.1 in PCLinuxOS 2012 32bit (mandriva based). 
 I'm getting an error at ReaderWriterJP2.o

 Code:
 Scanning dependencies of target osgdb_jp2
 [ 81%] Building CXX object 
 src/osgPlugins/jp2/CMakeFiles/osgdb_jp2.dir/ReaderWriterJP2.o
 /home/benjamin/flightgear2.9/src/OpenSceneGraph-3.1.1/src/osgPlugins/jp2/ReaderWriterJP2.cpp:
  In member function ‘virtual osgDB::ReaderWriter::ReadResult 
 ReaderWriterJP2::readImage(const std::string, const 
 osgDB::ReaderWriter::Options*) const’:
 /home/benjamin/flightgear2.9/src/OpenSceneGraph-3.1.1/src/osgPlugins/jp2/ReaderWriterJP2.cpp:224:85:
  error: ‘jas_stream_freopen’ was not declared in this scope
 /home/benjamin/flightgear2.9/src/OpenSceneGraph-3.1.1/src/osgPlugins/jp2/ReaderWriterJP2.cpp:
  In member function ‘virtual osgDB::ReaderWriter::WriteResult 
 ReaderWriterJP2::writeImage(const osg::Image, const std::string, const 
 osgDB::ReaderWriter::Options*) const’:
 /home/benjamin/flightgear2.9/src/OpenSceneGraph-3.1.1/src/osgPlugins/jp2/ReaderWriterJP2.cpp:428:86:
  error: ‘jas_stream_freopen’ was not declared in this scope
 make[2]: *** [src/osgPlugins/jp2/CMakeFiles/osgdb_jp2.dir/ReaderWriterJP2.o] 
 Error 1
 make[1]: *** [src/osgPlugins/jp2/CMakeFiles/osgdb_jp2.dir/all] Error 2
 make: *** [all] Error 2



 I have jasper packages installed: jasper libjasper1 libjasper1.701_1 
 libjasper1.701_1-devel libjasper-devel

 I'm building out of source:

 Code:
 cmake -D CMAKE_BUILD_TYPE=Release -D 
 CMAKE_INSTALL_PREFIX=/home/benjamin/flightgear2.9 ../OpenSceneGraph-3.1.1



 I don't know what's going on. Please help.

 Thank you!
 benjamin

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=49958#49958





 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OSG + Qt + Thread exception thread::run

2012-09-17 Thread Robert Osfield
Hi Francisco,

On 10 September 2012 20:09, Francisco frncs...@yahoo.es wrote:
 first off all sorry if is not easy to understand me because I can´t speak 
 English.

You might not be able to speak English, but you are doing pretty well
with the written English so far :-)

The OSG community might mostly converse in English but like yourself
it'll be a second language for many, perhaps even the majority of the
community so don't worry if you struggle a little with getting good
written English down on the page.

 I'm new to these issues and I have not much experience programming :)
 I'm trying to run a sample of OpenScenGraph Cookbook 3.

 It only works in release mode running it from Visual C + + 2008. In debug 
 mode or running it from outside VC++ doesn't work. I get an exception: access 
 violation ... blabla in subprocess RenderThread::run.

 It's strange because the other day it runs ok sometimes.

I'm not a Windows user, but the most common cause of crash I hear from
OSG Windows users is down to mixing of debug and release
libraries/applications at runtime.  VS can't handle this combining and
typically crashes and not always in an obvious fashion.  So this is
where I'd look first.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Multi-rendering per frame

2012-09-17 Thread Robert Osfield
Hi Harry,

The OSG by default is built around rendering to one FBO onces per
frame, I'd recommend not trying to get too clever with trying to reuse
FBO's within one frame.

Robert.

On 3 September 2012 10:15, Harry Li harry75...@gmail.com wrote:
 Hi,

 I have three pre-rendered render-to-texture cameras using frame-buffer-object 
 to generate a final texture for me at each frame. It works fine, but now I 
 want them to do the generation multiple times per frame, can you give me some 
 hints?

 I've tired the following methods but none of them works:
 1. To allow the group of cameras have multiple parents which belong to the 
 same root, so that the group of camera can be reused, but I'm afraid the 
 calculation of different path may be carried out simultaneously. Anyway, the 
 results is not as expected.

 2. To use osg::Sequence to group these cameras and setup it like this:

 Code:
 seq-setInterval(osg::Sequence::LOOP, 0, -1);
 seq-setNumRepeats(times_of_render_per_frame);


 This also doesn't work out.

 I was wondering whether it's due to the bugs in my code or simply I cannot 
 use the osg in such a way.


 ...

 Thank you!

 Cheers,
 Harry
 Code:




 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=49723#49723





 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgViewer takes over my standard input

2012-09-17 Thread Robert Osfield
Hi Christoffer,

The OSG does absolutely nothing with standard input, go have a look at
the whole source code base.  standard error and standard output are
used for debug and info messages but nothing is read.

So... this has to be a non OSG specific programming question, which I
suspect is likely to be down to a platform oddity on the platform you
are using.

Using standard input is a bit unusual for a rendering application,
might I suggest you just read the keyboard input from the actual
rendering window itself?

Robert.

On 11 September 2012 09:20, Christoffer Pettersson hoffe...@hotmail.com wrote:
 Hello, I'm trying to write a program where the renderer is running on a 
 separate thread. On the main thread I want to control the command line inputs 
 but as soon as I add scenedata to the osgViewer which is stored in the 
 renderer then the renderer takes over the standard input. std::cin in the 
 main thread is ignored. If I put std::cin in the renderer thread however the 
 program pauses and expects an input from the command line.

 Does anyone know how I can prevent osgViewer from taking over the command 
 line? I have attached sample code to this post where I demonstrate the 
 problem.


 Code:

 #include
 #include
 #include

 class MiniRenderer: public OpenThreads::Thread
 {
 public:
 void addModel(osg::Node* node)
 {
 _nodes.push_back(node);
 }

 void run()
 {
 _viewer.setUpViewInWindow(0, 0, 640, 480);
 _viewer.realize();
 _sceneRoot = new osg::Group;
 _run = true;
 while(_run)
 {
 if(_nodes.size()0)
 {
 for(unsigned int i = 0; i  _nodes.size(); ++i)
 _sceneRoot-addChild(_nodes[i]);
 _nodes.clear();
 _viewer.setSceneData(_sceneRoot.get());
 }
 int test = -2;
 std::cout  In Thread:   std::endl;
 std::cin  test;
 std::cout  In Thread :   test  std::endl;
 _viewer.frame();
 }
 }
 bool _run;
 osg::ref_ptr _sceneRoot;
 osgViewer::Viewer _viewer;
 std::vector  _nodes;
 };


 int main( int argc, char **argv )
 {
 std::cout  Starting thread  std::endl;
 MiniRenderer *minirenderer = new MiniRenderer();
 mr-startThread();

 osg::ref_ptr root = osgDB::readNodeFile(cessna.osg);
 minirenderer-addModel(root);
 int test = -1;

 std::cout  Main cin  std::endl;
 std::cin  test;
 std::cout  Main cin:   test  std::endl;

 while(true)
 {

 }
 return 0;
 }




 Kind Regards
 Hoffe

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=49913#49913





 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Open GL ES 3.0

2012-09-17 Thread Robert Osfield
Hi Katja,

I don't personally have any work plans for adding support for OpenGL
ES 3.0 but as you suggest this shouldn't be a difficult addition for
others to roll their sleeves up and add as the OSG is written around
coping with multiple version of OpenGL already so one would just use
the same extension scheme.

Robert.

On 30 August 2012 13:26, Katja Oechnser
katja.kristin.oechs...@continental-corporation.com wrote:
 Hi everyone,

 the specification of Open GL ES 3.0 has been released. So  I wonder if anyone 
 is planning to integrate it into osg?
 As far as i know it is compatible to OpenGL ES 2.0, but there are some more 
 features. For example would it be interesting if the new texture-compression 
 formats (ETC2/EAC and ASTC) will be supported in future (they are also part 
 of OpenGL 4.3).

 Does anyone plans something or has an idea how complex it is to do this 
 integration? I think it shouldn't be that hard because OGL ES is getting 
 closer to OpenGL...

 Thank you!

 Cheers,
 Katja

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=49687#49687





 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [vpb] error in building vpb

2012-09-17 Thread Robert Osfield
Hi Gowtam,

I would recommend using the svn/trunk version of VPB and OSG as these
are known to be compiling together OK - I've just compiled it myself
to double check.  I have gdal1-.7.3 installed so not as recent as your
version of gdal.  The svn/trunk of the OSG and VPB are most likely to
be able recent changes to the gdal API so this makes it doubly more
important to use the latest VPB/OSG.

Robert.

On 25 August 2012 16:03, Gowtam Maligireddy mgow...@gmail.com wrote:
 Hi,

 I am new to OSG. I am trying to build vpb-0.9.12 with OSG-2.9.9 and gdal-1.9. 
 I am getting following errors:
 please help me out.


  Creating library E:\VPBbuild\VirtualPlanetBuilder_build\lib\Release\vpb.lib 
 and object E:\VPBbuild\VirtualPlanetBuilder_build\lib\Release\vpb.exp
 1TaskManager.obj : error LNK2001: unresolved external symbol public: 
 virtual void __thiscall osg::Object::setThreadSafeRefUnref(bool) 
 (?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
 1ThreadPool.obj : error LNK2001: unresolved external symbol public: virtual 
 void __thiscall osg::Object::setThreadSafeRefUnref(bool) 
 (?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
 1SpatialProperties.obj : error LNK2001: unresolved external symbol public: 
 virtual void __thiscall osg::Object::setThreadSafeRefUnref(bool) 
 (?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
 1System.obj : error LNK2001: unresolved external symbol public: virtual 
 void __thiscall osg::Object::setThreadSafeRefUnref(bool) 
 (?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
 1TextureUtils.obj : error LNK2001: unresolved external symbol public: 
 virtual void __thiscall osg::Object::setThreadSafeRefUnref(bool) 
 (?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
 1Task.obj : error LNK2001: unresolved external symbol public: virtual void 
 __thiscall osg::Object::setThreadSafeRefUnref(bool) 
 (?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
 1ObjectPlacer.obj : error LNK2001: unresolved external symbol public: 
 virtual void __thiscall osg::Object::setThreadSafeRefUnref(bool) 
 (?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
 1ShapeFilePlacer.obj : error LNK2001: unresolved external symbol public: 
 virtual void __thiscall osg::Object::setThreadSafeRefUnref(bool) 
 (?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
 1Source.obj : error LNK2001: unresolved external symbol public: virtual 
 void __thiscall osg::Object::setThreadSafeRefUnref(bool) 
 (?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
 1SourceData.obj : error LNK2001: unresolved external symbol public: virtual 
 void __thiscall osg::Object::setThreadSafeRefUnref(bool) 
 (?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
 1FileUtils.obj : error LNK2001: unresolved external symbol public: virtual 
 void __thiscall osg::Object::setThreadSafeRefUnref(bool) 
 (?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
 1GeospatialDataset.obj : error LNK2001: unresolved external symbol public: 
 virtual void __thiscall osg::Object::setThreadSafeRefUnref(bool) 
 (?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
 1HeightFieldMapper.obj : error LNK2001: unresolved external symbol public: 
 virtual void __thiscall osg::Object::setThreadSafeRefUnref(bool) 
 (?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
 1MachinePool.obj : error LNK2001: unresolved external symbol public: 
 virtual void __thiscall osg::Object::setThreadSafeRefUnref(bool) 
 (?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
 1Destination.obj : error LNK2001: unresolved external symbol public: 
 virtual void __thiscall osg::Object::setThreadSafeRefUnref(bool) 
 (?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
 1ExtrudeVisitor.obj : error LNK2001: unresolved external symbol public: 
 virtual void __thiscall osg::Object::setThreadSafeRefUnref(bool) 
 (?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
 1FileCache.obj : error LNK2001: unresolved external symbol public: virtual 
 void __thiscall osg::Object::setThreadSafeRefUnref(bool) 
 (?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
 1FileDetails.obj : error LNK2001: unresolved external symbol public: 
 virtual void __thiscall osg::Object::setThreadSafeRefUnref(bool) 
 (?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
 1Commandline.obj : error LNK2001: unresolved external symbol public: 
 virtual void __thiscall osg::Object::setThreadSafeRefUnref(bool) 
 (?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
 1DatabaseBuilder.obj : error LNK2001: unresolved external symbol public: 
 virtual void __thiscall osg::Object::setThreadSafeRefUnref(bool) 
 (?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
 1DatabaseBuilderIO.obj : error LNK2001: unresolved external symbol public: 
 virtual void __thiscall osg::Object::setThreadSafeRefUnref(bool) 
 (?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
 1DataSet.obj : error LNK2001: unresolved external symbol public: virtual 
 void __thiscall osg::Object::setThreadSafeRefUnref(bool) 
 (?setThreadSafeRefUnref@Object@osg@@UAEX_N@Z)
 1BuildLog.obj : error LNK2001: unresolved external symbol public: virtual 
 void __thiscall osg::Object::setThreadSafeRefUnref(bool) 
 

Re: [osg-users] [osgPlugins] statically linking osgPlugins for Android

2012-09-17 Thread Robert Osfield
Hi James,

On 23 August 2012 16:01, James Cotton peabody...@gmail.com wrote:
 Great, thank you very much.  That fixed it!

 Edit: At the risk of derailing my own thread, the plugin then tries to find 
 imageio to load the textures, but that isn't available on android (and looks 
 like it's designed to be apple specific).  What plugin should I be looking at?

imageio is an Apple specific plugin for an Apple specific API so no
way that it'll ever be support on other platforms outside Apple's iOS
and OSX.

The image plugins for other platforms are all individual plugins
written to handle their own specific formats, so jpeg you'll find in
src/osgPlugins/jpeg, png your find in src/osgPlugins/png etc.  You'll
need to libjpeg and libpng dependencies for both of these plugins.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Self-Shadowing of Billboards

2012-09-17 Thread Robert Osfield
HI Regina,

This read a lot like spam to me and has no place on the OSG
forum/mailing list.  Has your account been hijacked?

Robert.

On 30 August 2012 06:48, Regina Howard reginahow...@live.com wrote:
 Billboards present large advertisements to passing pedestrians and drivers. 
 Today it is estimated that the average individual is bombarded with more than 
 5,000 advertisements every single day. With such an overabundance of 
 advertising, people have begun to mentally tune out advertising that they 
 consider clutter. That means that in order to get your message across to your 
 intended audience you have to really do something to make it stand out from 
 the competition (http://www.emeraldoutdoor.com/). Outdoor advertising reaches 
 its audience as an element of the environment.  Unlike newspaper, radio or 
 TV, it doesn't have to be invited into the home.  And it doesn't provide 
 entertainment to sustain its audience.

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=49673#49673




 Attachments:
 http://forum.openscenegraph.org//files/billboard_737.jpg


 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Opinions: is OpenSceneGraph the right choice?

2012-09-17 Thread Robert Osfield
Hi Randall,

On 5 September 2012 02:05, Randall Hand randall.h...@gmail.com wrote:
 I've been programming in OpenGL for several years now, and I'm about to start 
 a new project and thought OpenSG might be a good tool to use.  However, I'm 
 integrating data from lots of outside sources (gyros, cameras, network, etc) 
 so I can't just do a Viewer run() (looking at doing the Viewer frame() 
 thing), but I'm also going to have lots of frequently changing geometry  
 camera information.  All the demos I see simply construct a Scenegraph once 
 at program start, then do Viewer run().  Is it possible/advisable to have 
 frequently changing scenegraphs with OpenSG (eg, new nodes, dying nodes, 
 changing nodes, etc).

Wow, it's been quite a while since anyone got confused between OpenSG
and OpenSceneGraph, must be near a decade since the OpenSceneGraph
came out top in the battle of the most widely used open source scene
graphs...

As to answer your question, how to you modify OSG objects... well most
OSG application need to do just what you are doing, and either use
update, event, cull or draw callbacks, or add event handlers and
camera manipulators to the viewer, or simply provide updates via the
the viewer main loop.  The examples mostly use Viewer::run() but not
all, and Viewer::run() is really just a convenience method for writing
simply applications.  If you have a look at the actual Viewer::run()
implementation found in OpenSceneGraph/src/osgViewer/Viewer.cpp you'll
see a slightly more complicated version of:

viewer.realize();
while(!viewer.done())
{
viewer.advance();
viewer.eventTraversal();
viewer.updateTraversal();
viewer.renderingTraversals();
 }

You splice your own code in your frame loop.  You can even subclass
from Viewer/CompositeViewer and override all of these
eventTraversal(), updateTraversal() and renderingTraversals() methods.

In short there are dozens of different ways you can update you scene
graph, what is most appropriate will depend entirely down to your
applications needs.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] What is the Max size of the OSG model on Andoid

2012-09-17 Thread Koduri Lakshmi
Hi,

I am new to OSG Android. I build and tested osgAndroidExampleGLES1.

I am able to load osg models of any size in this example.

I made a similar example for testing. In this example i am able to load the 
models of size around  650MB. I am not able to load 700 MB models. It just 
flashing only once.

What should I do to load models of any size.

I am using OpenGLES1 

... 

Thank you!

Cheers,
Koduri

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=50134#50134




___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] What is the Max size of the OSG model on Andoid

2012-09-17 Thread Sergey Polischuk
Hi

i'm not entirely sure how you doing this, but on most android devices 
application memory usage limited to 16mb of ram. Recent versions upped this 
limit to 4gb but i dont think you'll be able to actually use any model even 
remotely close to that because of performance reasons.

Cheers.

17.09.2012, 16:51, Koduri Lakshmi ankiredd...@gmail.com:
 Hi,

 I am new to OSG Android. I build and tested osgAndroidExampleGLES1.

 I am able to load osg models of any size in this example.

 I made a similar example for testing. In this example i am able to load the 
 models of size around  650MB. I am not able to load 700 MB models. It just 
 flashing only once.

 What should I do to load models of any size.

 I am using OpenGLES1

 ...

 Thank you!

 Cheers,
 Koduri

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=50134#50134

 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Multi-rendering per frame

2012-09-17 Thread Sergey Polischuk
Hi

i think your best bet is to use some count of internal viewer frames between 
external ones, i.e. to disable clear on main camera, and shut it down with 
mask, but still render your rtt cameras between external frames.

17.09.2012, 11:50, Harry Li harry75...@gmail.com:
 Hi,

 I have three pre-rendered render-to-texture cameras using frame-buffer-object 
 to generate a final texture for me at each frame. It works fine, but now I 
 want them to do the generation multiple times per frame, can you give me some 
 hints?

 I've tired the following methods but none of them works:
 1. To allow the group of cameras have multiple parents which belong to the 
 same root, so that the group of camera can be reused, but I'm afraid the 
 calculation of different path may be carried out simultaneously. Anyway, the 
 results is not as expected.

 2. To use osg::Sequence to group these cameras and setup it like this:

 Code:
 seq-setInterval(osg::Sequence::LOOP, 0, -1);
 seq-setNumRepeats(times_of_render_per_frame);

 This also doesn't work out.

 I was wondering whether it's due to the bugs in my code or simply I cannot 
 use the osg in such a way.

 ...

 Thank you!

 Cheers,
 Harry
 Code:

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=49723#49723

 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] adding tool tips to objects in a 3D scene

2012-09-17 Thread Christian Buchner
Hi,

I've been asked to add some tool tips to objects in a 3D scene, and I
wonder if there is anything existing in OSG that would facilitate an
implementation.

Essentially as you hover over a 3D object and leave the mouse there
for about one second, it should pop up with a small overlay containing
some text string that is associated with that object. As soon as the
mouse is moved again, the overlay should vanish.

Could anyone here offer some advice into how to implement this such
behavior with least programming effort, and if possible in a portable
manner?

Christian
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] PROTO nodes are not reading

2012-09-17 Thread Jan Ciger
Hello,

On Sat, Sep 1, 2012 at 7:38 AM, Mahesh Manni mahesh_bi...@yahoo.co.inwrote:

 Hi,
 I am using VRML 0.17.12 version API for importing the vrml files.

 My importer is not reading the nodes that is declared under the PROTO
 keyword.

 Earlier, I have used VRML 0.14.2 version, where it is reading perfectly
 all kinds of declarations.



Could you precise what is the actual problem? Do you mean that the PROTOs
are not parsed by OpenVRML or they are not loaded into the OSG scene?

If it is the former, there isn't much we can do, you can file a bug report
on the OpenVRML project. I think that OpenVRML ships a test viewer/parser,
you can test your file with that one and see whether it parses correctly. I
think you aren't the only one with this issue, quick googling finds e.g.
this report:
http://sourceforge.net/apps/trac/openvrml/ticket/118

You may also want to update your OpenVRML, the bug may have been fixed in
the 0.18.x release.

If you mean the latter, I do not think PROTOs were ever loaded into the OSG
scene - these nodes define custom object types which can be literally
anything. The importer was meant to support loading of basic meshes, not
complex VRML scenes (it is not designed to be a VRML viewer!).

Regards,

Jan
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] What is the Max size of the OSG model on Andoid

2012-09-17 Thread Koduri Lakshmi
Hi,

Sorry for the wrong size.

I am able to load the model of size 650KB. If the model is 700KB then the 
model loading only once. That is why I am getting a flash on the screen.

Is there any setting where I need to specify size limit.

I am using OPENGLES1.
... 

Thank you!

Cheers,
Koduri

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=50140#50140




___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Is there something like an optimal way for integrating physics?

2012-09-17 Thread Paul Martz
My experience has been with Bullet, and if you've done any archive searches, 
then I'm sure you've came across osgBullet (osgbullet.googlecode.com). If you're 
concerned with performance, you should note that osgBullet supports running the 
physics simulation in a separate thread.


You are asking a lot about optimal ways of doing the integration. It's difficult 
for me to compare osgBullet's approach to what you have done, as I am not 
familiar with your code. But I can describe osgBullet's approach:


Bullet provides a btMotionState class, and osgBullet provides a derivation of 
that called MotionState that has a Transform member variable. During update, 
when the app steps the physics simulation, Bullet calls into the MotionState 
objects, which in turn updates the scene graph Transform nodes. Or, when running 
the physics simulation in a separate thread, the new Transform data is stored in 
an efficient triple buffer mechanism, then loaded into the scene graph during 
the update traversal. In osgBullet, no callbacks or custom Node types are required.


I hope this info is helpful. If you'd like to discuss osgBullet further, it has 
its own Google Group mailing list, and the source code Doxygen documentation is 
fairly complete and informative.

   -Paul


On 9/15/2012 3:16 AM, funk menera wrote:

Hi,

propably the answer depends on what is to be done with physics. (and has been 
discussed before?)

But i'm curious if someone can post his/her experiences with OSG and 
physics-integrations concerning performance differences.

Well, up to now i only tried PhysX ... and my answer rised because i found 
three ways for integrating PhysX:
- callback
- GUIEventAdapter
- node-integration
There might be more ...


Finally, let me say that i wanna do something in the direction of vehicle 
dynamics.
First using the 'pre-defined models', but afterwards maybe creating a more 
sophisticated model.
So i'm pretty sure, that i could use any physics engine ... maybe Bullet is 
better to be integrated into OSG than PhysX? Or the way round? Or Havok is 
faster?

Basically, i'm just wondering if there are 'notable' differences in performance 
concerning the different physics-SDKs and their ways of integration? 
(Especially in terms of vehicle dynamics)

Thank you very much!

Cheers,
funk

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=50073#50073





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Merging geometry data

2012-09-17 Thread Irbit Kirill
Hello dear Robert,

I have GTX280, Xeon 3GHz, windows XP sp3. Application uses osgEarth. If we load 
KML file with many similar objects we get problem, that I described.
I'd like to try solve the problem using plain OSG, then port solution to 
osgEarth. Now in osgEarth scene I have 2890 models and only 224 is unique. 
Yes, I used release built.

Thank you!

Cheers,
Kirill

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=50148#50148





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Rendering issues with `osgVolume::RayTracedTechnique`?

2012-09-17 Thread Robert Osfield
Hi Bastian,

It's likely to be a driver bug, or perhaps a sensitivity in the driver
to the GLSL shaders that are used - sometimes some drivers can be more
picky than others.  I previously worked with an ATI card under Linux
with osgVolume and didn't have problems so perhaps there has been a
regression on the driver front.

To investigate further you'll need to see if there are any OpenGL
errors reported - have a look on the console to see if the OSG has
picked up on any OpenGL errors.

Robert.

On 17 September 2012 15:27, Bastian Rieck
bastian.ri...@iwr.uni-heidelberg.de wrote:
 Dear list,

 we are currently facing rendering issues when using `RayTracedTechnique`
 instead of `FixedFunctionTechnique` for rendering with osgVolume.

 More precisely, we are using a Samsung NP305V5A notebook (with two AMD
 graphics cards) running Ubuntu 12.04 and OpenSceneGraph from the
 official packages (currently 3.0.1-2). See the attached screenshot for
 more details --- it shows the rendering issues that occur when trying to
 volume render a standard data set (engine block). The block is
 rendered normally when using `FixedFunctionTechnique`.

 Did anyone else encounter similar problems (maybe also with AMD graphics
 cards)? If so, how could we resolve them?

 We cannot reproduce the issue on our developer workstations (using
 Geforce GTX 480).

 We would be happy to add more information about this error but we
 currently do not know how to approach it properly. Any help would be
 appreciated.

 Kind regards,
   Bastian

 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Ideas about a resource system, and deferred rendering framework

2012-09-17 Thread Jeremy Moles
On Tue, 2012-09-11 at 10:54 +0800, Wang Rui wrote:
 Hi Jeremy,
 
 Thanks for the tests and feedback. I'm focusing on creating a material
 system which may be a little similar to the Ogre one but will be very
 easy to integrate with OSG scenes. I'd like to also have a benchmark
 including a complete deferred shading pipeline in the near future to
 show others how OSG produces realistic worlds. :-)
 
 Your requirement could be easiliy implemented with one forward pass
 rendering the scene to a texture, and two deferred passes doing the
 blur work with the texture as input. A final compositing pass will
 make use of the outputs of the blur passes and output to a new
 texture. You can get and use the new texture then in the scene for
 your own purpose instead of direct displaying them on screen. I'd like
 to upload a DOF effect file and an updated example some days later to
 demonstrate how these work.

Hi Wang,

Did you ever get a chance to work up an example showing something like
this? I've been trying to get it to work using a modified blur-x/blur-y
approach from osgPPU, but have had no success.

 Thanks,
 
 Wang Rui
 
 2012/9/11 Jeremy Moles cubic...@gmail.com:
  On Mon, 2012-09-10 at 22:57 +0800, Wang Rui wrote:
  This looks really cool so far. I'd be really interested to know if it
  supports the following (and would be willing to create examples if
  you're willing to help)...
 
  Scenario: I want to render an entire subgraph to an FBO texture once,
  then apply 2 or more completely different shaders in some order, then
  put the final result into a last texture to be used somewhere in the
  scene. I'm doing a guassian blur, which typically applies two different
  shaders for x and y.
 
  I have this working in osgPPU, but I think you already have enough to do
  it here, I just couldn't put the pieces together. :)
 
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [ANN] OSG SW SIM Engineer

2012-09-17 Thread Chris Hanson
On Thu, Sep 13, 2012 at 12:07 PM, Craig Hicks craighi...@simstaff.comwrote:

 Hello dear OSG-community,
 I have a direct position for a simulation client of mine that can be done
 off-site.  This is for a solid OSG programmer in the simulation arena.
  Salary is open at this point so if you are interested, please give me a
 holler back.


   Hi Craig, I suppose I should ask for details if you haven't found anyone
yet.



 Best regards,
 Craig

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=50028#50028





 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




-- 
Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com
http://www.alphapixel.com/
Training • Consulting • Contracting
3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 •
GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
Digital Imaging • GIS • GPS • Telemetry • Cryptography • Digital Audio •
LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Merging geometry data

2012-09-17 Thread Robert Osfield
Hi Kirill,

On 17 September 2012 16:18, Irbit Kirill formus...@mail.ru wrote:
 I have GTX280, Xeon 3GHz, windows XP sp3. Application uses osgEarth. If we 
 load KML file with many similar objects we get problem, that I described.
 I'd like to try solve the problem using plain OSG, then port solution to 
 osgEarth. Now in osgEarth scene I have 2890 models and only 224 is unique.
 Yes, I used release built.

Thanks for the figures.  I asked plenty more questions besides this, I
asked the questions to try and get enough information to know how to
help you, so please have a look back at my previous email to see what
other questions I had about what performance you are getting already,
what performance you are expecting etc and what the present
bottlenecks are.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Using OSG Embedded in an Existing OpenGL Project

2012-09-17 Thread Shayne Tueller
To render OSG in an existing OGL viewport, you still need to create an OSG 
viewer because that is what kicks off the OSG traversals when the frame() 
method is called. You also need to manage (i.e. Push and Pop) OGL state 
correctly since OSG and OGL share the same render context so that you don't 
trash your existing OGL rendering state.

Anyway, here's basically what you do to setup and render OSG stuff in an OGL 
viewport/window. This uses CompositeViewer so you could render multiple OSG 
viewports embedded inside an OGL window...:)

osgViewer::CompositeViewer *viewer = new osgViewer::CompositeViewer();
osgViewer::GraphicsWindowEmbedded *gw = new osgViewer::GraphicsWindow(ogl_x, 
ogl_y, ogl_w, ogl_h); 

osgViewer::View *view = new osgViewer::View;
view-getCamera-setGraphicsContext(gw);
view-getCamera-setViewport(osg_x, osg_y, osg_w, osg_h); // somewhere inside 
OGL viewport/window that has origin in LL corner
.
.
// set rest of the view OSG camera state and matrices as usual
.
.
view-setSceneData(scenegraph);
viewer-addView(view);
viewer-realize();
.
.

// do this during rendering loop for each OGL frame...
PushOGLState();
viewer-frame(); // render OSG embedded viewport in OGL window
PopOGLState();

Hope this helps...

Shayne[/code]

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=50153#50153





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] OpenGL context and wglGetProcAddress

2012-09-17 Thread Peterakos
Hello.

I am trying to use an external widget library in osg.
This library tries to load the opengl functions during initialization using
wglGetProcAddress.

This procedure works in opengl but not in open scene graph. It fails for
functions in gl 1.2 and later.
I found this: The Microsoft Windows DLL opengl32.dll only directly
exposes *OpenGL
1.1* functions. To gain access to functions from higher GL versions, you
must load these function pointers manually with wglGetProcAddress.

So the library cant load the functions using wglGetProcAddress.

Is there any reason for that happening ?


Thank you for your time.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Using a texture channel outside of OSG

2012-09-17 Thread Thomas Hogarth
Hi All

So I'm using an extension on iOS that allows me to fast draw video frames
coming from the camera in OpenGL.

The requirement though is that I bind and create the texture during a callback 
so I have to call makeCurrent on the osg context then do manual OpenGL 
commands, like below.


Code:
_viewer-getCamera()-getGraphicsContext()-makeCurrent();

[self cleanUpTextures];

// CVOpenGLESTextureCacheCreateTextureFromImage will create GLES texture
// optimally from CVImageBufferRef.

glActiveTexture(GL_TEXTURE5);
err = CVOpenGLESTextureCacheCreateTextureFromImage(kCFAllocatorDefault,
   _videoTextureCache,
   pixelBuffer,
   NULL,
   GL_TEXTURE_2D,
   GL_RGBA,
   width,
   height,
   GL_BGRA,
   GL_UNSIGNED_BYTE,
   0,
   _lumaTexture);
if (err)
{
NSLog(@Error at CVOpenGLESTextureCacheCreateTextureFromImage %d, err);
}

glBindTexture(CVOpenGLESTextureGetTarget(_lumaTexture), 
CVOpenGLESTextureGetName(_lumaTexture));
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);



I then use a uniform to tell osg where to look for the texture, in this case 
channel 5 and everything works fine. The problems start when I introduce models 
loaded and rendered with osg. All the models only use textures in channel 0, 
but as soon as I start using them the video quad goes black and other textures 
start flickering.

My guess is osg is is doing something to my texture, is there a way to tell osg 
to leave a certain channel alone, or some other sort of magic?

Thanks
Tom

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=50157#50157





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Using a texture channel outside of OSG

2012-09-17 Thread Sergey Polischuk
Hi

you should let osg know of what are you doing with opengl state, or revert it 
back when done drawing your texture.
f.e. if osg thinks that active texture unit is 0, and it actually 5 after your 
gl stuff bad things can happed, as next osg call to glBindTexture will leave 
texture unit 0 without texture assigned, and it will sit unused in slot 5.

if you can use osg state in place where you call gl functions, i can suggest 
you to use osg state setActiveTexture(...) instead of glActiveTexture calls, 
and set active texture back (you can get current with osg state 
getActiveTexture()) after you finished with your texture.
if not - you can try just call glActiveTexture(GL_TEXTURE0); after you are done.

Cheers.

17.09.2012, 23:12, Thomas Hogarth thomas.hoga...@gmail.com:
 Hi All

 So I'm using an extension on iOS that allows me to fast draw video frames
 coming from the camera in OpenGL.

 The requirement though is that I bind and create the texture during a 
 callback so I have to call makeCurrent on the osg context then do manual 
 OpenGL commands, like below.

 Code:
 _viewer-getCamera()-getGraphicsContext()-makeCurrent();

 [self cleanUpTextures];

 // CVOpenGLESTextureCacheCreateTextureFromImage will create GLES texture
 // optimally from CVImageBufferRef.

 glActiveTexture(GL_TEXTURE5);
 err = CVOpenGLESTextureCacheCreateTextureFromImage(kCFAllocatorDefault,
    _videoTextureCache,
    pixelBuffer,
    NULL,
    GL_TEXTURE_2D,
    GL_RGBA,
    width,
    height,
    GL_BGRA,
    GL_UNSIGNED_BYTE,
    0,
    _lumaTexture);
 if (err)
 {
 NSLog(@Error at CVOpenGLESTextureCacheCreateTextureFromImage %d, 
 err);
 }

 glBindTexture(CVOpenGLESTextureGetTarget(_lumaTexture), 
 CVOpenGLESTextureGetName(_lumaTexture));
 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);

 I then use a uniform to tell osg where to look for the texture, in this case 
 channel 5 and everything works fine. The problems start when I introduce 
 models loaded and rendered with osg. All the models only use textures in 
 channel 0, but as soon as I start using them the video quad goes black and 
 other textures start flickering.

 My guess is osg is is doing something to my texture, is there a way to tell 
 osg to leave a certain channel alone, or some other sort of magic?

 Thanks
 Tom

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=50157#50157

 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Using a texture channel outside of OSG

2012-09-17 Thread Thomas Hogarth
Thanks for that

calling glActiveTexture(GL_TEXTURE0); at the end has worked, I'll 
try a more elegant solution later, but at least this has proved it can work.

Pretty obvious solution, think I'd just been working on it too long. 


Thanks for the help
Tom

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=50159#50159





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Errors after switch to osgEarth

2012-09-17 Thread Michael W. Hall
Will do.  Thought about that after I posted.

On Sat, 2012-09-15 at 01:36 -0400, Glenn Waldron wrote:
 Michael,
 
 
 May I suggest you post osgEarth questions to the osgEarth forum at:
 http://forum.osgearth.org
 
 
 Please go there and post your earth file. Thanks.
 
 
 Glenn Waldron / @glennwaldron
 
 
 On Fri, Sep 14, 2012 at 7:30 PM, Michael W. Hall hal...@att.net
 wrote:
 I am receiving the following errors after switching to reading
 files
 with osgEarth:
 
 [osgEarth]* [GDAL driver] Dataset has no spatial reference
 information: 
 /home/hallmw/Projects/osgMap/Build/bin/Data/land_shallow_topo_east.tif
 [osgEarth]* Could not initialize TileSource for layer
 east-tiff
 ERROR 10: Pointer 'hDS' is NULL in 'GDALClose'.
 
 [osgEarth]* [GDAL driver] Dataset has no spatial reference
 information: 
 /home/hallmw/Projects/osgMap/Build/bin/Data/land_shallow_topo_east.tif
 [osgEarth]* Could not initialize TileSource for layer
 east-tiff
 ERROR 10: Pointer 'hDS' is NULL in 'GDALClose'.
 
 [osgEarth]* [ImageLayer] Error: layer does not have a valid
 TileSource,
 cannot create image
 [osgEarth]* [GDAL driver] Dataset has no spatial reference
 information: 
 /home/hallmw/Projects/osgMap/Build/bin/Data/land_shallow_topo_west.tif
 [osgEarth]* Could not initialize TileSource for layer
 west-tiff
 ERROR 10: Pointer 'hDS' is NULL in 'GDALClose'.
 
 [osgEarth]* [GDAL driver] Dataset has no spatial reference
 information: 
 /home/hallmw/Projects/osgMap/Build/bin/Data/land_shallow_topo_west.tif
 [osgEarth]* Could not initialize TileSource for layer
 west-tiff
 ERROR 10: Pointer 'hDS' is NULL in 'GDALClose'.
 
 [osgEarth]* [ImageLayer] Error: layer does not have a valid
 TileSource,
 cannot create image
 [osgEarth]* [GDAL driver] Dataset has no spatial reference
 information: 
 /home/hallmw/Projects/osgMap/Build/bin/Data/land_shallow_topo_east.tif
 [osgEarth]* Could not initialize TileSource for layer
 east-tiff
 ERROR 10: Pointer 'hDS' is NULL in 'GDALClose'.
 
 [osgEarth]* [GDAL driver] Dataset has no spatial reference
 information: 
 /home/hallmw/Projects/osgMap/Build/bin/Data/land_shallow_topo_west.tif
 [osgEarth]* Could not initialize TileSource for layer
 west-tiff
 ERROR 10: Pointer 'hDS' is NULL in 'GDALClose'.
 
 [osgEarth]* [GDAL driver] Dataset has no spatial reference
 information: 
 /home/hallmw/Projects/osgMap/Build/bin/Data/land_shallow_topo_east.tif
 [osgEarth]* Could not initialize TileSource for layer
 east-tiff
 ERROR 10: Pointer 'hDS' is NULL in 'GDALClose'.
 
 [osgEarth]* [GDAL driver] Dataset has no spatial reference
 information: 
 /home/hallmw/Projects/osgMap/Build/bin/Data/land_shallow_topo_west.tif
 [osgEarth]* Could not initialize TileSource for layer
 west-tiff
 ERROR 10: Pointer 'hDS' is NULL in 'GDALClose'.
 
 Object::connect: No such slot QMainWindow::open()
 in /home/hallmw/Projects/osgMap/src/osgmap/MainWindow.cpp:88
 Inconsistency detected by ld.so: dl-close.c: 737: _dl_close:
 Assertion
 `map-l_init_called' failed!
 
 Previously, I was reading .ive files with my program.  I
 switched to
 osgEarth and I am getting the above errors.  I am assuming
 they are
 coming from osgEarth.
 
 All I see is a white sphere.  No image of the BMNG on that
 sphere.  I am
 not sure what I am missing.  I call osgDB::readNodeFile() and
 it appears
 that the file is recognized.  Any ideas?
 
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
 
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Using OSG Embedded in an Existing OpenGL Project

2012-09-17 Thread Thomas Hogarth
Hi

So I've done this when working with the QCAR sdk as it seems
to insist on having ownership of the GL Context. 

What you want is first setup the emmbeded viewer


Code:
osg::ref_ptrosgViewer::Viewer viewer = new osgViewer::Viewer();
osg::ref_ptrosgViewer::GraphicsWindowEmbedded embeddedWindow
embeddedWindow = viewer-setUpViewerAsEmbeddedInWindow(0, 0, w,h);
osg::ref_ptrosg::StateSet m_lastStateSet = new osg::StateSet();
viewer-getCamera()-getGraphicsContext()-getState()-captureCurrentState(*m_lastStateSet.get());
 




Then in your OpenGL apps render function after you have done your raw OpenGL 
stuff you want something like

osg::State *osgState = _viewer-getCamera()-getGraphicsContext()-getState(); 
osgState-reset(); 
osgState-apply(m_lastStateSet.get()); 

//render your osg frame here
viewer-frame();

//now get the state so you can restore next frame
viewer-getCamera()-getGraphicsContext()-getState()-captureCurrentState(*m_lastStateSet.get());
 


Hope that helps
Tom

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=50167#50167





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org