Re: [osg-users] shaders in OSG...

2008-11-14 Thread Jean-Sébastien Guay

Hi Shayne,


It turned out that I was NOT using ref_ptr. I made the correction and it no
longer crashes...:).


Yeah, always store pointers to reference counted objects in ref_ptrs if 
you intend to keep a pointer to it around. The OSG examples create nodes 
and other objects as raw pointers, but they do so in an anonymous scope 
(between { ... } ) so that we're sure not to hold on to the raw pointer 
- the variable ceases to exist when the scope ends.


As I said, it's a common gotcha.

Just for reference, I bet if you had run your program in a debugger and 
put a breakpoint at the line before the crash occured, and then 
inspected the value of the program pointer, you would have seen it's 
garbage, which would have tipped you off that it was a memory / dangling 
pointer / reference counting problem.



Problems solved. THANK YOU!


Good to know. Glad to have been able to help,

J-S
--
__
Jean-Sebastien Guay[EMAIL PROTECTED]
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] osgswig compiled (on intrepid, OSG 2.4.0) but examples segfault

2008-11-14 Thread Patrick Bouffard
Curiosity got the better of me and I went ahead and upgraded to
Intrepid, which allowed me to get OSG 2.4.0 out of the standard
repositories. I was then able to build osgswig successfully, but I
can't get any of the examples to work, they all segfault:

[EMAIL PROTECTED]:~/dev/osgswig-read-only/examples/python$ ./simpleosg.py
Segmentation fault

[EMAIL PROTECTED]:~/dev/osgswig-read-only/examples/python$ python -v pyramid.py
# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
# /usr/lib/python2.5/site.pyc matches /usr/lib/python2.5/site.py
import site # precompiled from /usr/lib/python2.5/site.pyc
# /usr/lib/python2.5/os.pyc matches /usr/lib/python2.5/os.py
import os # precompiled from /usr/lib/python2.5/os.pyc
import errno # builtin
import posix # builtin
# /usr/lib/python2.5/posixpath.pyc matches /usr/lib/python2.5/posixpath.py
import posixpath # precompiled from /usr/lib/python2.5/posixpath.pyc
# /usr/lib/python2.5/stat.pyc matches /usr/lib/python2.5/stat.py
import stat # precompiled from /usr/lib/python2.5/stat.pyc
# /usr/lib/python2.5/UserDict.pyc matches /usr/lib/python2.5/UserDict.py
import UserDict # precompiled from /usr/lib/python2.5/UserDict.pyc
# /usr/lib/python2.5/copy_reg.pyc matches /usr/lib/python2.5/copy_reg.py
import copy_reg # precompiled from /usr/lib/python2.5/copy_reg.pyc
# /usr/lib/python2.5/types.pyc matches /usr/lib/python2.5/types.py
import types # precompiled from /usr/lib/python2.5/types.pyc
import _types # builtin
# /usr/lib/python2.5/new.pyc matches /usr/lib/python2.5/new.py
import new # precompiled from /usr/lib/python2.5/new.pyc
# zipimport: found 9 names in
/usr/lib/python2.5/site-packages/configobj-4.4.0-py2.5.egg
# /usr/lib/python2.5/sitecustomize.pyc matches
/usr/lib/python2.5/sitecustomize.py
import sitecustomize # precompiled from /usr/lib/python2.5/sitecustomize.pyc
# /usr/lib/python2.5/site-packages/apport_python_hook.pyc matches
/usr/lib/python2.5/site-packages/apport_python_hook.py
import apport_python_hook # precompiled from
/usr/lib/python2.5/site-packages/apport_python_hook.pyc
# /usr/lib/python2.5/warnings.pyc matches /usr/lib/python2.5/warnings.py
import warnings # precompiled from /usr/lib/python2.5/warnings.pyc
# /usr/lib/python2.5/linecache.pyc matches /usr/lib/python2.5/linecache.py
import linecache # precompiled from /usr/lib/python2.5/linecache.pyc
import encodings # directory /usr/lib/python2.5/encodings
# /usr/lib/python2.5/encodings/__init__.pyc matches
/usr/lib/python2.5/encodings/__init__.py
import encodings # precompiled from /usr/lib/python2.5/encodings/__init__.pyc
# /usr/lib/python2.5/codecs.pyc matches /usr/lib/python2.5/codecs.py
import codecs # precompiled from /usr/lib/python2.5/codecs.pyc
import _codecs # builtin
# /usr/lib/python2.5/encodings/aliases.pyc matches
/usr/lib/python2.5/encodings/aliases.py
import encodings.aliases # precompiled from
/usr/lib/python2.5/encodings/aliases.pyc
# /usr/lib/python2.5/encodings/utf_8.pyc matches
/usr/lib/python2.5/encodings/utf_8.py
import encodings.utf_8 # precompiled from /usr/lib/python2.5/encodings/utf_8.pyc
Python 2.5.2 (r252:60911, Oct  5 2008, 19:24:49)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
# /home/patrick/dev/osgswig-read-only/build/lib/python/osg.pyc matches
/home/patrick/dev/osgswig-read-only/build/lib/python/osg.py
import osg # precompiled from
/home/patrick/dev/osgswig-read-only/build/lib/python/osg.pyc
dlopen("/home/patrick/dev/osgswig-read-only/build/lib/python/_osg.so", 2);
import _osg # dynamically loaded from
/home/patrick/dev/osgswig-read-only/build/lib/python/_osg.so
# /usr/lib/python2.5/weakref.pyc matches /usr/lib/python2.5/weakref.py
import weakref # precompiled from /usr/lib/python2.5/weakref.pyc
dlopen("/usr/lib/python2.5/lib-dynload/_weakref.so", 2);
import _weakref # dynamically loaded from
/usr/lib/python2.5/lib-dynload/_weakref.so
# /home/patrick/dev/osgswig-read-only/build/lib/python/osgDB.pyc
matches /home/patrick/dev/osgswig-read-only/build/lib/python/osgDB.py
import osgDB # precompiled from
/home/patrick/dev/osgswig-read-only/build/lib/python/osgDB.pyc
dlopen("/home/patrick/dev/osgswig-read-only/build/lib/python/_osgDB.so", 2);
import _osgDB # dynamically loaded from
/home/patrick/dev/osgswig-read-only/build/lib/python/_osgDB.so
# /home/patrick/dev/osgswig-read-only/build/lib/python/osgGA.pyc
matches /home/patrick/dev/osgswig-read-only/build/lib/python/osgGA.py
import osgGA # precompiled from
/home/patrick/dev/osgswig-read-only/build/lib/python/osgGA.pyc
dlopen("/home/patrick/dev/osgswig-read-only/build/lib/python/_osgGA.so", 2);
import _osgGA # dynamically loaded from
/home/patrick/dev/osgswig-read-only/build/lib/python/_osgGA.so
# /home/patrick/dev/osgswig-read-only/build/lib/python/osgViewer.pyc
matches /home/patrick/dev/osgswig-read-only/build/lib/python/osgViewer.py
import osgViewer # precompiled from
/home/patrick/dev/osgswig-read-only/build/lib/python/osgViewer.pyc
dlopen("/home/pa

Re: [osg-users] Compile error - ConvertUTF on osgDB in Cygwin

2008-11-14 Thread Brian Keener
Robert Osfield wrote:
> I have just reviewed Alberto's fix and I'm not happy with it as it
> stands, I don't cygwin to test against so I can't test this myself,
> but I do wonder if defining wstring ourselves for Cygwin would be a
> workable solution i.e. add the following to ConvertUTF:
> 
> #ifdef __CYGWIN__
> namespace std
> {
> typedef basic_string wstring;
> }
> #endif
> 
> I've attached a modified ConvertUTF.  Could you try this out in place
> of Alberto's changes.  In theory you'll be able to revert to the svn
> version of ConvertUTF.cpp as well is this works fine.
> 
> If this work I'll check this in.


I placed your attachment in place of the include file and then moved 
Alberto's ConvertUTF.cpp out of the way and retrieved the current 
version from SVN.  Compiles just fine.

Anything I can run/test to verify it functions properly? 

bk



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


Re: [osg-users] shaders in OSG...

2008-11-14 Thread Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC
J-S,

It turned out that I was NOT using ref_ptr. I made the correction and it no
longer crashes...:).

I also moved my shader switch to the UpdateCallback and things work just
great once I synchronized the OGL rendering.

Problems solved. THANK YOU!

-Shayne

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Jean-Sébastien Guay
Sent: Friday, November 14, 2008 1:08 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] shaders in OSG...

Hi Shayne,

> At this point, anything will help. I believe I'm using a ref pointer but I
> will double check. I tried following the paradigm outlined in the
osgshaders
> example which seems to be "newing" the same way I'm doing below (i.e. new
> osg::Program).

As long as you're using ref_ptr, that's fine. It's just a common gotcha...

> The reason for the postdraw callback is that I'm rendering OGL symbology
on
> top of an OSG view. I don't want the shader to be on when I render the
> symbology. Perhaps I need to turn shaders off in an update callback before
> the post drawback is hit.?.?

Yes. You can always use some way to synchronize so that the OGL stuff 
doesn't render until the update callback has run.

> On the complete program, it's a little difficult to include everything
since
> my email machine is different from my development machine. If it's needed,
I
> could try to include the whole program as an attachment...

I don't mean the whole program (in fact, we'd prefer not the whole 
program). Just modify a small example to demonstrate the problem (even 
with a trivial shader, say that turns everything red).

So for example, modify 
OpenSceneGraph/applications/osgviewer/osgviewer.cpp, apply a shader to 
the loaded file, and then remove and re-add the shader in the same way 
as you do in your app. If this reproduces the problem, send it here.

J-S
-- 
__
Jean-Sebastien Guay[EMAIL PROTECTED]
http://www.cm-labs.com/
 http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


smime.p7s
Description: S/MIME cryptographic signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgswig binary release?

2008-11-14 Thread Phan, Linh H
Hi Gerwin,

  I finally got the osgswig svn compiled with osg 2.4 using MinGW but I can't
seem to import the resulting DLLs (eg _osg.pyd) with python 2.5 win32 binary:

>>> import sys; 
>>> sys.path.append('c:\\cygwin-1.7\\usr\\local\\src\\buildosgswig\\lib\\python')
>>> import osg
Traceback (most recent call last):
  File "", line 1, in 
import osg
  File "/usr/local/src/buildosgswig/lib/python/osg.py", line 7, in 
import _osg
ImportError: DLL load failed: The specified module could not be found.

But the _osg.pyd is in the python sys.path:
[EMAIL PROTECTED] ...src/osg]$ cygcheck 
c:/cygwin-1.7/usr/local/src/buildosgswig/lib/python/_osg.pyd
C:\cygwin-1.7\usr\local\src\buildosgswig\lib\python\_osg.pyd
  C:\WINDOWS\system32\KERNEL32.dll
C:\WINDOWS\system32\ntdll.dll
  C:\WINDOWS\system32\msvcrt.dll
  C:\WINDOWS\system32\OPENGL32.DLL
C:\WINDOWS\system32\ADVAPI32.dll
  C:\WINDOWS\system32\RPCRT4.dll
C:\WINDOWS\system32\Secur32.dll
C:\WINDOWS\system32\GDI32.dll
  C:\WINDOWS\system32\USER32.dll
C:\WINDOWS\system32\GLU32.dll
C:\WINDOWS\system32\DDRAW.dll
  C:\WINDOWS\system32\DCIMAN32.dll
  C:\e\cg\osg\buildosg\lib\libOpenThreads.dll
  C:\e\cg\osg\buildosg\lib\libosg.dll
  C:\WINDOWS\system32\python25.dll
C:\WINDOWS\system32\SHELL32.dll
  C:\WINDOWS\system32\SHLWAPI.dll
C:\cygwin-1.7\usr\local\src\osg\MSVCR71.dll

I can compile a simple "hello world" python extension using
the MinGW g++ compiler and loaded into the python 2.5 win32 binary but
I don't know why it's not working for the osgswig extensions.

Thank you Gerwin,

Linh
PS  I also posted the problem on the osgswig google code site.


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gerwin de Haan
Sent: Thursday, November 13, 2008 11:48 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] osgswig binary release?

Dear Linh,

I'm not sure the osgswig svn still builds on and is tested on osg 2.3.4 (even 
when using more mainstream linux compilers or MS visual studio). I personally 
am still stuck on osg 2.4 (linux), other report that osg 2.6 and up works ok 
with some known limtiations. We as osgswig contributors have not yet put clear 
mechanisms in place to keep up with the various osg versions. Please post the 
versions, error messages and other details of your findings on the osgswig 
google code site, so we might be able to assist you.

regards,
Gerwin
On Fri, Nov 14, 2008 at 2:11 AM, Phan, Linh H <[EMAIL PROTECTED]> wrote:
Hi,

  I'm having a real hard time compiling osgswig (gotten from osgswig svn) for 
OpenSceneGraph 2.3.4 on Windows using MinGW or cygwin.  The README said that it 
has been tested with OpenSceneGraph 2.3.4.  Does anyone have a 
pre-built Windows binary for osgswig that they can make available?  I would 
really appreciate it.

Thank you,

Linh



___
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] osgswig binary release?

2008-11-14 Thread Phan, Linh H
Hi Luigi,

  thanks for your osg.zip!  However, whenever I run pickosg.py :

[EMAIL PROTECTED] ~...examples/python]$ ./pickosg.py
Warning: Could not find plugin to read objects from file "cow.osg".

It seems that this line:

loadedModel = osgDB.readNodeFile("cow.osg")

always return None.  I then explicitly include the osgPlugins-2.6.0 directory 
in pickosg.py via:

#!c:/Python25/python.exe
import sys;
sys.path.append('c:\\cygwin-1.7\\usr\\local\\src\\osg\\osgPlugins-2.6.0');

but it still could not find plugin.  Do you know what I'm doing wrong?

Thank you Luigi,

Linh

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Luigi Calori
Sent: Friday, November 14, 2008 3:12 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] osgswig binary release?

Here
http://virtualrome.googlecode.com/svn/trunk/py_code/py25_apps/PyPackages/osg.zip

you can find an osgSwig (from some month ago, with some patches) I has
been built with Visual Stusio 7.1 against OSG 2.5 (included with the zip)
It has been tested with python 2.5 win32 binary, you can test by adding
the folder where you extract the zip to the PYTHONPATH env variable

I'm  trying to build osgSwig svn with OSG 2.6 (Viual Studio
compiler)buth there is a still unsolved problem, reported in
http://code.google.com/p/osgswig/issues/detail?id=12#c3
due to substitution of std::vector with osg::MixinVectors   (this low
level change prevents wrapper access to functions for building arrays)
I also had to make some changes to build as reported in
http://code.google.com/p/osgswig/issues/detail?id=13

If interested, let me know

Luigi


Phan, Linh H ha scritto:
> Hi,
>
>   I'm having a real hard time compiling osgswig (gotten from osgswig
> svn) for OpenSceneGraph 2.3.4 on Windows using MinGW or cygwin.  The
> README said that it has been tested with OpenSceneGraph 2.3.4.  Does
> anyone have a pre-built Windows binary for osgswig that they can make
> available?  I would really appreciate it.
>
> Thank you,
>
> Linh
>
>
> 
>
> ___
> 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] Problem with 2D scene

2008-11-14 Thread frankmiller
osgUtil/CullVisitor.cpp line 644-645:

  // whole object behind the eye point so discard
  return false;

Perhaps its not called "culling" in this case but my code hits this return
statement and as a result, the drawable is not added to the StateGraphList in
RenderBin. OpenGL is never given a chance to clip.

Frank

On Fri, Nov 14, 2008 at 08:22:31PM +, Robert Osfield wrote:
> Hi Frank,
> 
> If culling is switched off then culling is off, the eye point will
> make no difference.
> 
> What difference you moving the eye point will be in the clipping due
> to the position of near/far plane.
> 
> Robert.
> 
> On Fri, Nov 14, 2008 at 8:09 PM,  <[EMAIL PROTECTED]> wrote:
> > I think I figured it out. It looks like even with culling turned off,
> > nodes that are behind the "eye point" are culled. See
> > osgUtil/CullVisitor.cpp line 645.
> >
> > I now calculate the view matrix as follows.
> >
> >  osg::Matrixd matrix = osg::Matrixd::translate( -center );
> >  matrix.postMultRotate( osg::Quat( PI, osg::Vec3d( 1.0, 0.0, 0.0 ) ) );
> >  matrix.postMultTranslate( osg::Vec3d( 0.0, 0.0, -0.5 ) );
> >
> > Adding the last translation transform to push the nodes away from the
> > "eye point" made the problem go away.
> >
> > Is this a bug?
> >
> > Frank
> >
> > On Thu, Nov 13, 2008 at 11:38:14AM -0500, [EMAIL PROTECTED] wrote:
> >> Hi Robert,
> >>
> >> Thanks for the quick response. That was a good suggestion. However it
> >> looks like that is not the problem. All of my nodes live on the z=0.0
> >> plane and my projection matrix is
> >>
> >>   osg::Matrixd::ortho( -aspectRatio, aspectRatio, -1.0, 1.0, -1.0, 1.0 )
> >>
> >> I have attached a small code sample that exhibits the problem.
> >>
> >> Frank
> >>
> >> On Thu, Nov 13, 2008 at 04:24:37PM +, Robert Osfield wrote:
> >> > Hi Frank,
> >> >
> >> > My best guess is that your projection matrix isn't wide enough to
> >> > encompass your scene and near/far clipping is clipping out the
> >> > fragments.  This may well look like culling, often users do mistake
> >> > clipping with culling so chase up the wrong part of the pipeline.
> >> >
> >> > Robert.
> >> >
> >> > On Thu, Nov 13, 2008 at 4:18 PM,  <[EMAIL PROTECTED]> wrote:
> >> > > Greetings osg community,
> >> > >
> >> > > I'm have written a custom MatrixManipulator for a 2D scene and I am
> >> > > experiencing a strange problem. As I pan and zoom around, some of the
> >> > > nodes in the scene disappear abruptly as if they are being culled
> >> > > inappropriately. However, disabling culling has no effect.
> >> > >
> >> > > The behavior is erratic and unpredictable which smells to me like I'm 
> >> > > on
> >> > > the border of a floating point inequality. I have discovered two ways
> >> > > that seem to make the problem go away.
> >> > >
> >> > > One:
> >> > >
> >> > >  One of the transformations I use to construct the view matrix is
> >> > >
> >> > >osg::Matrixd::rotate( osg::Quat( PI, osg::Vec3d( 1.0, 0.0, 0.0 ) ) )
> >> > >
> >> > >  If I replace that with
> >> > >
> >> > >osg::Matrixd::scale( osg::Vec3d( 1.0, -1.0, 1.0 ) )
> >> > >
> >> > >  the problem seems to go away.
> >> > >
> >> > > Two:
> >> > >
> >> > >  All of the nodes in my seen that exhibit this problem have a 2D
> >> > >  bounding box. i.e.
> >> > >
> >> > > osg::BoundingBox const & bb = pGeode->getBoundingBox();
> >> > > assert( bb.zMax() - bb.zMin() < 1e-5 );
> >> > >
> >> > >  If I give the nodes some depth so that the above assert would fail,
> >> > >  the problem seems to go away.
> >> > >
> >> > > I suspect that these are not actual solutions. In any case, I would 
> >> > > like
> >> > > to understand what is happening under the covers. Any ideas?
> >> > >
> >> > > Frank
> >> > >
> >> > > ___
> >> > > 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
> >
> >>
> >> #include 
> >> #include 
> >> #include 
> >>
> >> #include 
> >> #include 
> >>
> >> osg::ref_ptr< osg::Node > CreateGraph()
> >>   {
> >>   osg::ref_ptr< osg::Geode >pGeode= new osg::Geode();
> >>   osg::ref_ptr< osg::Geometry > pGeometry = new osg::Geometry();
> >>   pGeode->addDrawable( pGeometry.get() );
> >>
> >>   // Vertices
> >>   osg::ref_ptr< osg::Vec3Array > pVerts = new osg::Vec3Array( 4 );
> >>   (*pVerts)[ 0 ] = osg::Vec3( 0.0, 0.0, 0.0 );
> >>   (*pVerts)[ 1 ] = osg::Vec3( 1.0, 0.0, 0.0 );
> >>   (*pVerts)[ 2 ] = osg::Vec3( 1.0, 1.0, 0.0 );
> >>   (*pVerts)[ 3 ] = osg::Vec3( 0.0, 1.0, 0.0 ); // dosen't work
> >>   //(*pVerts)[ 3 ] = osg::Vec3( 0.0, 1.0, 0.1 ); // works as expected
> >>   pGeometry->setVertexArray( pVerts.get() );
> >>
> >>   pGeometry->addPrimitiveSet( new osg::DrawAr

Re: [osg-users] Problem with 2D scene

2008-11-14 Thread Robert Osfield
Hi Frank,

If culling is switched off then culling is off, the eye point will
make no difference.

What difference you moving the eye point will be in the clipping due
to the position of near/far plane.

Robert.

On Fri, Nov 14, 2008 at 8:09 PM,  <[EMAIL PROTECTED]> wrote:
> I think I figured it out. It looks like even with culling turned off,
> nodes that are behind the "eye point" are culled. See
> osgUtil/CullVisitor.cpp line 645.
>
> I now calculate the view matrix as follows.
>
>  osg::Matrixd matrix = osg::Matrixd::translate( -center );
>  matrix.postMultRotate( osg::Quat( PI, osg::Vec3d( 1.0, 0.0, 0.0 ) ) );
>  matrix.postMultTranslate( osg::Vec3d( 0.0, 0.0, -0.5 ) );
>
> Adding the last translation transform to push the nodes away from the
> "eye point" made the problem go away.
>
> Is this a bug?
>
> Frank
>
> On Thu, Nov 13, 2008 at 11:38:14AM -0500, [EMAIL PROTECTED] wrote:
>> Hi Robert,
>>
>> Thanks for the quick response. That was a good suggestion. However it
>> looks like that is not the problem. All of my nodes live on the z=0.0
>> plane and my projection matrix is
>>
>>   osg::Matrixd::ortho( -aspectRatio, aspectRatio, -1.0, 1.0, -1.0, 1.0 )
>>
>> I have attached a small code sample that exhibits the problem.
>>
>> Frank
>>
>> On Thu, Nov 13, 2008 at 04:24:37PM +, Robert Osfield wrote:
>> > Hi Frank,
>> >
>> > My best guess is that your projection matrix isn't wide enough to
>> > encompass your scene and near/far clipping is clipping out the
>> > fragments.  This may well look like culling, often users do mistake
>> > clipping with culling so chase up the wrong part of the pipeline.
>> >
>> > Robert.
>> >
>> > On Thu, Nov 13, 2008 at 4:18 PM,  <[EMAIL PROTECTED]> wrote:
>> > > Greetings osg community,
>> > >
>> > > I'm have written a custom MatrixManipulator for a 2D scene and I am
>> > > experiencing a strange problem. As I pan and zoom around, some of the
>> > > nodes in the scene disappear abruptly as if they are being culled
>> > > inappropriately. However, disabling culling has no effect.
>> > >
>> > > The behavior is erratic and unpredictable which smells to me like I'm on
>> > > the border of a floating point inequality. I have discovered two ways
>> > > that seem to make the problem go away.
>> > >
>> > > One:
>> > >
>> > >  One of the transformations I use to construct the view matrix is
>> > >
>> > >osg::Matrixd::rotate( osg::Quat( PI, osg::Vec3d( 1.0, 0.0, 0.0 ) ) )
>> > >
>> > >  If I replace that with
>> > >
>> > >osg::Matrixd::scale( osg::Vec3d( 1.0, -1.0, 1.0 ) )
>> > >
>> > >  the problem seems to go away.
>> > >
>> > > Two:
>> > >
>> > >  All of the nodes in my seen that exhibit this problem have a 2D
>> > >  bounding box. i.e.
>> > >
>> > > osg::BoundingBox const & bb = pGeode->getBoundingBox();
>> > > assert( bb.zMax() - bb.zMin() < 1e-5 );
>> > >
>> > >  If I give the nodes some depth so that the above assert would fail,
>> > >  the problem seems to go away.
>> > >
>> > > I suspect that these are not actual solutions. In any case, I would like
>> > > to understand what is happening under the covers. Any ideas?
>> > >
>> > > Frank
>> > >
>> > > ___
>> > > 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
>
>>
>> #include 
>> #include 
>> #include 
>>
>> #include 
>> #include 
>>
>> osg::ref_ptr< osg::Node > CreateGraph()
>>   {
>>   osg::ref_ptr< osg::Geode >pGeode= new osg::Geode();
>>   osg::ref_ptr< osg::Geometry > pGeometry = new osg::Geometry();
>>   pGeode->addDrawable( pGeometry.get() );
>>
>>   // Vertices
>>   osg::ref_ptr< osg::Vec3Array > pVerts = new osg::Vec3Array( 4 );
>>   (*pVerts)[ 0 ] = osg::Vec3( 0.0, 0.0, 0.0 );
>>   (*pVerts)[ 1 ] = osg::Vec3( 1.0, 0.0, 0.0 );
>>   (*pVerts)[ 2 ] = osg::Vec3( 1.0, 1.0, 0.0 );
>>   (*pVerts)[ 3 ] = osg::Vec3( 0.0, 1.0, 0.0 ); // dosen't work
>>   //(*pVerts)[ 3 ] = osg::Vec3( 0.0, 1.0, 0.1 ); // works as expected
>>   pGeometry->setVertexArray( pVerts.get() );
>>
>>   pGeometry->addPrimitiveSet( new osg::DrawArrays( osg::PrimitiveSet::QUADS, 
>> 0, 4 ) );
>>
>>   osg::ref_ptr< osg::Vec4Array > pColors = new osg::Vec4Array( 4 );
>>   (*pColors)[ 0 ] = osg::Vec4( 1.0f, 1.0f, 1.0f, 1.0f );
>>   (*pColors)[ 1 ] = osg::Vec4( 1.0f, 0.0f, 0.0f, 1.0f );
>>   (*pColors)[ 2 ] = osg::Vec4( 0.0f, 1.0f, 0.0f, 1.0f );
>>   (*pColors)[ 3 ] = osg::Vec4( 0.0f, 0.0f, 1.0f, 1.0f );
>>   pGeometry->setColorArray( pColors.get() );
>>   pGeometry->setColorBinding( osg::Geometry::BIND_PER_VERTEX );
>>
>>   osg::ref_ptr< osg::StateSet > pState = pGeode->getOrCreateStateSet();
>>   pState->setMode( GL_LIGHTING, osg::StateAttribute::OFF );
>>
>>   osg::BoundingBox const & bb 

Re: [osg-users] Problem with 2D scene

2008-11-14 Thread frankmiller
I think I figured it out. It looks like even with culling turned off,
nodes that are behind the "eye point" are culled. See
osgUtil/CullVisitor.cpp line 645.

I now calculate the view matrix as follows.

  osg::Matrixd matrix = osg::Matrixd::translate( -center );
  matrix.postMultRotate( osg::Quat( PI, osg::Vec3d( 1.0, 0.0, 0.0 ) ) );
  matrix.postMultTranslate( osg::Vec3d( 0.0, 0.0, -0.5 ) );

Adding the last translation transform to push the nodes away from the
"eye point" made the problem go away.

Is this a bug?

Frank

On Thu, Nov 13, 2008 at 11:38:14AM -0500, [EMAIL PROTECTED] wrote:
> Hi Robert,
> 
> Thanks for the quick response. That was a good suggestion. However it
> looks like that is not the problem. All of my nodes live on the z=0.0
> plane and my projection matrix is
> 
>   osg::Matrixd::ortho( -aspectRatio, aspectRatio, -1.0, 1.0, -1.0, 1.0 )
> 
> I have attached a small code sample that exhibits the problem.
> 
> Frank
> 
> On Thu, Nov 13, 2008 at 04:24:37PM +, Robert Osfield wrote:
> > Hi Frank,
> > 
> > My best guess is that your projection matrix isn't wide enough to
> > encompass your scene and near/far clipping is clipping out the
> > fragments.  This may well look like culling, often users do mistake
> > clipping with culling so chase up the wrong part of the pipeline.
> > 
> > Robert.
> > 
> > On Thu, Nov 13, 2008 at 4:18 PM,  <[EMAIL PROTECTED]> wrote:
> > > Greetings osg community,
> > >
> > > I'm have written a custom MatrixManipulator for a 2D scene and I am
> > > experiencing a strange problem. As I pan and zoom around, some of the
> > > nodes in the scene disappear abruptly as if they are being culled
> > > inappropriately. However, disabling culling has no effect.
> > >
> > > The behavior is erratic and unpredictable which smells to me like I'm on
> > > the border of a floating point inequality. I have discovered two ways
> > > that seem to make the problem go away.
> > >
> > > One:
> > >
> > >  One of the transformations I use to construct the view matrix is
> > >
> > >osg::Matrixd::rotate( osg::Quat( PI, osg::Vec3d( 1.0, 0.0, 0.0 ) ) )
> > >
> > >  If I replace that with
> > >
> > >osg::Matrixd::scale( osg::Vec3d( 1.0, -1.0, 1.0 ) )
> > >
> > >  the problem seems to go away.
> > >
> > > Two:
> > >
> > >  All of the nodes in my seen that exhibit this problem have a 2D
> > >  bounding box. i.e.
> > >
> > > osg::BoundingBox const & bb = pGeode->getBoundingBox();
> > > assert( bb.zMax() - bb.zMin() < 1e-5 );
> > >
> > >  If I give the nodes some depth so that the above assert would fail,
> > >  the problem seems to go away.
> > >
> > > I suspect that these are not actual solutions. In any case, I would like
> > > to understand what is happening under the covers. Any ideas?
> > >
> > > Frank
> > >
> > > ___
> > > 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

> 
> #include 
> #include 
> #include 
> 
> #include 
> #include 
> 
> osg::ref_ptr< osg::Node > CreateGraph()
>   {
>   osg::ref_ptr< osg::Geode >pGeode= new osg::Geode();
>   osg::ref_ptr< osg::Geometry > pGeometry = new osg::Geometry();
>   pGeode->addDrawable( pGeometry.get() );
> 
>   // Vertices
>   osg::ref_ptr< osg::Vec3Array > pVerts = new osg::Vec3Array( 4 );
>   (*pVerts)[ 0 ] = osg::Vec3( 0.0, 0.0, 0.0 );
>   (*pVerts)[ 1 ] = osg::Vec3( 1.0, 0.0, 0.0 );
>   (*pVerts)[ 2 ] = osg::Vec3( 1.0, 1.0, 0.0 );
>   (*pVerts)[ 3 ] = osg::Vec3( 0.0, 1.0, 0.0 ); // dosen't work
>   //(*pVerts)[ 3 ] = osg::Vec3( 0.0, 1.0, 0.1 ); // works as expected
>   pGeometry->setVertexArray( pVerts.get() );
> 
>   pGeometry->addPrimitiveSet( new osg::DrawArrays( osg::PrimitiveSet::QUADS, 
> 0, 4 ) );
> 
>   osg::ref_ptr< osg::Vec4Array > pColors = new osg::Vec4Array( 4 );
>   (*pColors)[ 0 ] = osg::Vec4( 1.0f, 1.0f, 1.0f, 1.0f );
>   (*pColors)[ 1 ] = osg::Vec4( 1.0f, 0.0f, 0.0f, 1.0f );
>   (*pColors)[ 2 ] = osg::Vec4( 0.0f, 1.0f, 0.0f, 1.0f );
>   (*pColors)[ 3 ] = osg::Vec4( 0.0f, 0.0f, 1.0f, 1.0f );
>   pGeometry->setColorArray( pColors.get() );
>   pGeometry->setColorBinding( osg::Geometry::BIND_PER_VERTEX );
> 
>   osg::ref_ptr< osg::StateSet > pState = pGeode->getOrCreateStateSet();
>   pState->setMode( GL_LIGHTING, osg::StateAttribute::OFF );
> 
>   osg::BoundingBox const & bb = pGeode->getBoundingBox();
>   std::cout
> << "BoundingBox = ("
> << bb.xMin() << ","
> << bb.yMin() << ","
> << bb.zMin() << ","
> << bb.xMax() << ","
> << bb.yMax() << ","
> << bb.zMax() << ")"
> << std::endl;
> 
>   return pGeode.get();
>   }
> 
> int main( int argc, char * argv[] )
>   {
>   int const x = 100;
>   int const y = 100;
>   int const w = 800;

Re: [osg-users] shaders in OSG...

2008-11-14 Thread Jean-Sébastien Guay

Hi Shayne,


At this point, anything will help. I believe I'm using a ref pointer but I
will double check. I tried following the paradigm outlined in the osgshaders
example which seems to be "newing" the same way I'm doing below (i.e. new
osg::Program).


As long as you're using ref_ptr, that's fine. It's just a common gotcha...


The reason for the postdraw callback is that I'm rendering OGL symbology on
top of an OSG view. I don't want the shader to be on when I render the
symbology. Perhaps I need to turn shaders off in an update callback before
the post drawback is hit.?.?


Yes. You can always use some way to synchronize so that the OGL stuff 
doesn't render until the update callback has run.



On the complete program, it's a little difficult to include everything since
my email machine is different from my development machine. If it's needed, I
could try to include the whole program as an attachment...


I don't mean the whole program (in fact, we'd prefer not the whole 
program). Just modify a small example to demonstrate the problem (even 
with a trivial shader, say that turns everything red).


So for example, modify 
OpenSceneGraph/applications/osgviewer/osgviewer.cpp, apply a shader to 
the loaded file, and then remove and re-add the shader in the same way 
as you do in your app. If this reproduces the problem, send it here.


J-S
--
__
Jean-Sebastien Guay[EMAIL PROTECTED]
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] set the position of a model

2008-11-14 Thread Francisco Rodríguez Villagómez
Hi guys, I hope anyone could help me, I'm new to osg an Im making an
application in wich I have to point at some models with an arrow model to
specify wich of this models the user has selected, so my problem is how can
I set the position of the arrow if I dont know where the oder models are set
in the scene? I wish anyone could give me a hand with these.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] shaders in OSG...

2008-11-14 Thread Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC
J-S, 

At this point, anything will help. I believe I'm using a ref pointer but I
will double check. I tried following the paradigm outlined in the osgshaders
example which seems to be "newing" the same way I'm doing below (i.e. new
osg::Program).

The reason for the postdraw callback is that I'm rendering OGL symbology on
top of an OSG view. I don't want the shader to be on when I render the
symbology. Perhaps I need to turn shaders off in an update callback before
the post drawback is hit.?.?

FYI, the OSG and OGL are sharing the same render context but I'm pushing and
popping state appropriately...

On the complete program, it's a little difficult to include everything since
my email machine is different from my development machine. If it's needed, I
could try to include the whole program as an attachment...

What's your pleasure?

-Shayne

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Jean-Sébastien Guay
Sent: Friday, November 14, 2008 12:41 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] shaders in OSG...

Hi Shayne,

> // shader code done at setup time
> tgpProgram = new osg::Program();

...

> emptyProgram = new osg::Program();

First, I don't know if you meant not to put the type here, but I hope 
you're storing these in ref_ptr. Otherwise, you create the 
program (refCount = 0), then you attach the program to some node 
(refCount = 1), then detach it (refCount=0, the program is deleted) and 
thus you're using a dangling pointer the next time you try to attach it 
to a node.

Second, you're running the code in a draw callback, and not an update 
callback. You need to run it in an update callback. The draw traversal 
(even the end of the draw traversal) is not a safe place to be modifying 
the scene graph.

Can you send us a complete program that shows the problem? It's much 
easier that way around.

Hope this helps,

J-S
-- 
__
Jean-Sebastien Guay[EMAIL PROTECTED]
http://www.cm-labs.com/
 http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


smime.p7s
Description: S/MIME cryptographic signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] shaders in OSG...

2008-11-14 Thread Jean-Sébastien Guay

Hi Shayne,


// shader code done at setup time
tgpProgram = new osg::Program();


...


emptyProgram = new osg::Program();


First, I don't know if you meant not to put the type here, but I hope 
you're storing these in ref_ptr. Otherwise, you create the 
program (refCount = 0), then you attach the program to some node 
(refCount = 1), then detach it (refCount=0, the program is deleted) and 
thus you're using a dangling pointer the next time you try to attach it 
to a node.


Second, you're running the code in a draw callback, and not an update 
callback. You need to run it in an update callback. The draw traversal 
(even the end of the draw traversal) is not a safe place to be modifying 
the scene graph.


Can you send us a complete program that shows the problem? It's much 
easier that way around.


Hope this helps,

J-S
--
__
Jean-Sebastien Guay[EMAIL PROTECTED]
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] shaders in OSG...

2008-11-14 Thread Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC
Here's my code snippet...

// shader code done at setup time
tgpProgram = new osg::Program();
tgpState = tgp.view->getCamera()->getOrCreateStateSet();
tgpVertexObject = new osg::Shader(osg::Shader::VERTEX);
tgpFLIRFragmentObject = new osg::Shader(osg::Shader::FRAGMENT);
tgpProgram->addShader(tgpFLIRFragmentObject);
tgpProgram->addShader(tgpVertexObject);
loadShaderSource(tgpVertexObject, "shaders\\texture.vert");
loadShaderSource(tgpFLIRFragmentObject, "shaders\\flirwh_texture.frag");
tgpState->setAttributesAndModes(tgpProgram, osg::StateAttribute::ON);

emptyProgram = new osg::Program();
.
.
.
// callback hit at runtime
struct TGPPostDrawCallback : public osg::Camera::DrawCallback
{
TGPPostDrawCallback(){}
virtual void operator () (const osg::Camera& camera) const
{
// turn shader off
tgpState->setAttributeAndModes(emptyProgram);
RenderTGPOverlay();

// turn shaders back on? This line crashes the app with an
access violation!
tgpState->setAttributesAndModes(tgpProgram,
osg::StateAttributes::ON); 
}
}

On the above callback, I've also tried removing the attributes, adding and
removing the shaders from the program, and nothing has worked.

If I modify the above callback with the following instead, then it works...

struct TGPPostDrawCallback : public osg::Camera::DrawCallback
{
TGPPostDrawCallback(){}
virtual void operator () (const osg::Camera& camera) const
{
// turn shaders off

emptyProgram->apply(*(tgp.view->getCamera()->getGraphicsContext()->getState(
;
RenderTGPOverlay();
// turn shaders back on

tgpProgram->apply(*(tgp.view->getCamera()->getGraphicsContext()->getState())
));
}
}

I would just like to see a code snippet that cleanly allows switching
between multiple shaders or turning shaders on and off for a given object. I
know I can do this easily in OpenGL. OSG is proving to be otherwise.

Any ideas on what I'm doing wrong or what I'm missing? 

I'm all ears...
-Shayne

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mike
Weiblen
Sent: Friday, November 14, 2008 10:16 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] shaders in OSG...

hmm, I was unaware of crash bugs in Program switching.  If you could
create a simple repro, I'd be interested.
-- mew


On Fri, Nov 14, 2008 at 9:48 AM, Tueller,  Shayne R Civ USAF AFMC 519
SMXS/MXDEC <[EMAIL PROTECTED]> wrote:
> Mike,
>
> Thanks for the reply. There was an exchange on this subject back on August
> 28 in the archives. I tried all the suggested solutions to the problem to
no
> avail. I have tried binding to an "empty" program as you suggest by using
> the call ss->SetAttributesAndModes(new osg::Program()) which does indeed
> turn off the shader (back to fixed functionality). But when I attempt to
> switch back to the shader with another call to
> ss->SetAttributesAndModes(MyShaderProgram), it crashes my OpenSceneGraph
> app.
>
> I've tried the other suggestions such as removing the shaders from the
> program and then adding them back on for enable/disable and also the call
> ss->RemoveAttribute(MyShaderProgram) which have also caused a crash on the
> ensuing call ss->SetAttributesAndModes(MyShaderProgram). The only
mechanism
> that has worked cleanly for me is if I create two programs, one that is
> empty and one that has my vertex/fragment shaders attached. When I call
each
> programs "apply" method to switch the shaders off and on, this seems to
> work. I'm not sure if this the correct way to do it though.
>
> I've also noticed that there is no clean way of switching between multiple
> programs attached to a single object during runtime. At least I haven't
> found a way to get it to work in OSG. In OpenGL, I've always been able to
> have multiple programs that I can swap in and out via the call to
> glUseProgram() with the appropriate program handle (including the call
> glUseProgram(0) to switch to the fixed pipe). I don't see an equivalent
> mechanism in OpenSceneGraph to achieve the same functionality.
>
> If you or anyone else can enlighten me, it would be most appreciated...
>
> -Shayne
>
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Mike
> Weiblen
> Sent: Thursday, November 13, 2008 11:33 AM
> To: OpenSceneGraph Users
> Subject: Re: [osg-users] shaders in OSG...
>
> The only way to turn off a glProgram in GL is glUseProgram(0), there
> is no glEnable/glDisable.
>
> In OSG you do that by creating an "empty" osg::Program, one with no
> osg::Shaders attached.  Just attach that empty osg::Program where you
> want to revert to fixed-function.  Further details in
> http://mew.cx/osg_glsl_july2005.pdf
>
> cheers
> -- mew
>
>
>
> On Wed, Nov 12, 2008 at 2:55 PM, Tueller,  Shayne R Civ USAF AFMC 519
> SMXS/MXDEC <[EMAIL PROTECTED]> wrote:
>> Hello,
>

Re: [osg-users] Question: Does the osgGA::TrackballManipulator re-orient the xyz axes to be y Up, and z positive into the screen?

2008-11-14 Thread Paul Martz
See the setCoordinateFrameCallback() and possible the setHomePosition()
methods. The TrackballManipulator defaults to z up, but you can set it to be
whatever you wish. 
   -Paul



> 
> Hi.  Does anyone know if the osgGA::TrackballManipulator 
> re-orient the xyz axes to be y Up, and z positive into the 
> screen?  Through the use of some sort of hidden projection?  
> I can't find any documentation on this at all but when I get 
> the manipulator's view matrix, pull out the translation 
> vector and add to the Z value and finally put the rotation 
> matrix & the updated translation vector back together, my 
> scene moves up or down and NOT into or away from the scene.  
> When I alter the Y value, I move into or away from the scene. 
>  X works as expected.
> 
> This is very confusing for a newbie.  Thx!!!
> 
> --
> Sincerely, Allen
> Senior Software Engineer
> ITT-CAS, Inc
> 111 Research Blvd
> Madison, AL 35758
> Ps 34:5 "I sought the Lord, and he heard me; and he delivered 
> me from all my fears"
> 
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-opensce
> negraph.org
> 

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


Re: [osg-users] Performance expectations

2008-11-14 Thread Paul Martz
Hi all -- When someone posts with a high framerate requirement, all too
often we reply as if the poster is some newbie who just read his first Quake
II perf spec. While it's possible that the poster only has one monitor and
one window, and is just a little simple-minded, it's more likely that the
poster is trying to use OSG for some high-end rendering.

I can think of two requirements for 1000 FPS:

1. The CPU doing the rendering must be free for other tasks roughly 90% of
the time, due to application requirements and end-user hardware limitations.

2. The app needs to render 8 images at 120 Hz (or any other such
combination). (I think Mike's work falls into this category.)

(There are probably other such situations; those are just off the top of my
head.)

I'm not sure what OSG can do for the first situation; I know there's no way
to limit the amount of time OSG spends processing a single frame. However,
the multithreading support in osgViewer helps out with the second situation.
If you're system has eight cores, this becomes a GPU issue.
   -Paul

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


Re: [osg-users] X3D content

2008-11-14 Thread John F. Richardson
Convert to VRML 97. Then load the VRML 97. Check the Web3D consortium
website for converters.

 

John F. Richardson

 

  _  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of ami guru
Sent: Monday, November 10, 2008 7:56 AM
To: OpenSceneGraph Users
Subject: [osg-users] X3D content

 

Does OSG has any support node to load X3D content?


Sajjad

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


[osg-users] Question: Does the osgGA::TrackballManipulator re-orient the xyz axes to be y Up, and z positive into the screen?

2008-11-14 Thread Allen
Hi.  Does anyone know if the osgGA::TrackballManipulator re-orient the 
xyz axes to be y Up, and z positive into the screen?  Through the use of 
some sort of hidden projection?  I can't find any documentation on this 
at all but when I get the manipulator's view matrix, pull out the 
translation vector and add to the Z value and finally put the rotation 
matrix & the updated translation vector back together, my scene moves up 
or down and NOT into or away from the scene.  When I alter the Y value, 
I move into or away from the scene.  X works as expected.


This is very confusing for a newbie.  Thx!!!

--
Sincerely, Allen
Senior Software Engineer
ITT-CAS, Inc
111 Research Blvd
Madison, AL 35758
Ps 34:5 "I sought the Lord, and he heard me; and he delivered me from all my 
fears"

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


Re: [osg-users] osgswig cmake problem

2008-11-14 Thread Patrick Bouffard
Hmm, I think I need a newer version of OSG. I guess I was hopeful I
already had it based on what I read at
http://openscenegraph.dachary.org/:

"If you're running Debian GNU/Linux or Ubuntu, openscenegraph 2.4 is
already there. "

... which may be true on Intrepid but I'm on Hardy and hope to not
have to upgrade just for this.

Does anyone have 2.4.0 installed on Hardy via apt-get? Is there a PPA
with it out there somewhere I haven't been able to find?

I know I *should* be able to compile it from source but I'd like to
avoid going down that rabbit-hole..

On Fri, Nov 14, 2008 at 11:07 AM, Patrick Bouffard
<[EMAIL PROTECTED]> wrote:
> Thanks Gerrick. Actually after posting I thought about it some more
> and got a bit farther. What I needed to do was install some more
> packages (libopenthreads-dev and libopenscenegraph-dev). Now cmake
> completes successfully and my problem is with make:
>
> [EMAIL PROTECTED]:~/dev/osgswig-read-only/build$ make
> /usr/bin/cmake -H/home/patrick/dev/osgswig-read-only
> -B/home/patrick/dev/osgswig-read-only/build --check-build-system
> CMakeFiles/Makefile.cmake 0
> /usr/bin/cmake -E cmake_progress_start
> /home/patrick/dev/osgswig-read-only/build/CMakeFiles
> /home/patrick/dev/osgswig-read-only/build/CMakeFiles/progress.make
> make -f CMakeFiles/Makefile2 all
> make[1]: Entering directory `/home/patrick/dev/osgswig-read-only/build'
> make -f src/python/CMakeFiles/_osg.dir/build.make
> src/python/CMakeFiles/_osg.dir/depend
> make[2]: Entering directory `/home/patrick/dev/osgswig-read-only/build'
> /usr/bin/cmake -E cmake_progress_report
> /home/patrick/dev/osgswig-read-only/build/CMakeFiles 2
> [  2%] Swig source
> cd /home/patrick/dev/osgswig-read-only/build/src/python &&
> /usr/bin/swig -python -make_default -outdir
> /home/patrick/dev/osgswig-read-only/build/lib/python -c++
> -I/usr/include -I/home/patrick/dev/osgswig-read-only/include
> -I/usr/include/python2.5 -o
> /home/patrick/dev/osgswig-read-only/build/src/python/osgPYTHON_wrap.cxx
> /home/patrick/dev/osgswig-read-only/src/python//osg.i
> /home/patrick/dev/osgswig-read-only/src/python//../osg.i:503: Error:
> Unable to find 'osg/MixinVector'
> make[2]: *** [src/python/osgPYTHON_wrap.cxx] Error 1
> make[2]: Leaving directory `/home/patrick/dev/osgswig-read-only/build'
> make[1]: *** [src/python/CMakeFiles/_osg.dir/all] Error 2
> make[1]: Leaving directory `/home/patrick/dev/osgswig-read-only/build'
> make: *** [all] Error 2
>
>
> On Fri, Nov 14, 2008 at 11:02 AM, Gerrick Bivins
> <[EMAIL PROTECTED]> wrote:
>> Hi Patrick,
>> Those variables have to be defined by the user so osgswig knows where your
>> OSG is installed.
>> If you run ccmake like so:
>>
>>  >mkdir build
>>  >cd build
>>  >ccmake ../
>>
>>  you can set these variables to point to the correct location in the
>> interface.
>> I'm sure there is a way to define them via command line cmake, but I use
>> either the GUI for cmake on win or ccmake on linux/mac so someone else would
>> have to tell you how.
>> Gerrick
>>
>>
>> On 11/14/08 9:43 AM, "Patrick Bouffard" <[EMAIL PROTECTED]>
>> wrote:
>>
>>> Hi, I have OSG 2.4 installed via apt-get on my ubuntu 8.04 system. I fetched
>>> osgswig from svn and did as per the README:
>>>
>>> mkdir build
>>> cd build
>>> cmake ..  -DCMAKE_BUILD_TYPE=Release
>>>
>>> .. and get:
>>>
>>> -- Warning osg not found, OSG_LIBRARY tring to use: OSG_LIBRARY_DEBUG
>>> -- Warning osgUtil not found, OSGUTIL_LIBRARY tring to use:
>>> OSGUTIL_LIBRARY_DEBUG
>>> -- Warning osgDB not found, OSGDB_LIBRARY tring to use: OSGDB_LIBRARY_DEBUG
>>> -- Warning osgText not found, OSGTEXT_LIBRARY tring to use:
>>> OSGTEXT_LIBRARY_DEBUG
>>> -- Warning osgTerrain not found, OSGTERRAIN_LIBRARY tring to use:
>>> OSGTERRAIN_LIBRARY_DEBUG
>>> -- Warning osgFX not found, OSGFX_LIBRARY tring to use: OSGFX_LIBRARY_DEBUG
>>> -- Warning osgViewer not found, OSGVIEWER_LIBRARY tring to use:
>>>
>>> OSGVIEWER_LIBRARY_DEBUG
>>> -- Warning osgGA not found, OSGGA_LIBRARY tring to use: OSGGA_LIBRARY_DEBUG
>>> -- Warning osgSim not found, OSGSIM_LIBRARY tring to use: 
>>> OSGSIM_LIBRARY_DEBUG
>>> -- Warning osgShadow not found, OSGSHADOW_LIBRARY tring to use:
>>>
>>> OSGSHADOW_LIBRARY_DEBUG
>>> -- Warning osgManipulator not found, OSGMANIPULATOR_LIBRARY tring to use:
>>> OSGMANIPULATOR_LIBRARY_DEBUG
>>> -- Warning osgParticle not found, OSGPARTICLE_LIBRARY tring to use:
>>>
>>> OSGPARTICLE_LIBRARY_DEBUG
>>> CMake Error: The following variables are used in this project, but they are
>>> set
>>>
>>> to NOTFOUND.
>>> Please set them or make sure they are set and tested correctly in the CMake
>>> files:
>>> OPENTHREADS_LIBRARY (ADVANCED)
>>> linked by target "_osg" in directory
>>> /home/patrick/dev/osgswig-read-only/src/python
>>> linked by target "_osgDB" in directory
>>> /home/patrick/dev/osgswig-read-only/src/python
>>> linked by target "_osgFX" in directory
>>> /home/patrick/dev/osgswig-read-only/src/python
>>> linked by target "_osgGA" in directory
>>> /

Re: [osg-users] osgswig binary release?

2008-11-14 Thread Luigi Calori
Hi Gerwin, I subscribed to SWIG list and read that response too, I' ll 
try to do some test on that because I really want to be able to run my 
python app code on more recent OSG
I' ll let you know if any success, I' m also applying some mod to make 
the latest svn compile under msvc 7.1.


If you have any suggestion, please let me know.

Is someone still working on osgSwig?

Thanks
 Luigi


Gerwin de Haan ha scritto:

Luigi,

As far as the wrapping of osg::MixinVectors goes to support osg 2.6 
and on with osgswig, I did get a response from the swig maintainer 
William Fulton on how to go about on this:


"... The easiest is probably to run SWIG -E on std_vector.i and copy 
paste and change std to osg and vector to MixinVector. You'll see that 
there is a lot of code developed for some of these target languages 
and you could provide a much simpler cut down api, something similar 
to the Java approach, see Lib/java/std_vector.i."


I'm not sure I find a timeslot to do this anytime soon.
Gerwin



On Fri, Nov 14, 2008 at 12:12 PM, Luigi Calori <[EMAIL PROTECTED] 
> wrote:


Here

http://virtualrome.googlecode.com/svn/trunk/py_code/py25_apps/PyPackages/osg.zip

you can find an osgSwig (from some month ago, with some patches) I
has been built with Visual Stusio 7.1 against OSG 2.5 (included
with the zip)
It has been tested with python 2.5 win32 binary, you can test by
adding the folder where you extract the zip to the PYTHONPATH env
variable

I'm  trying to build osgSwig svn with OSG 2.6 (Viual Studio
compiler)buth there is a still unsolved problem, reported in
http://code.google.com/p/osgswig/issues/detail?id=12#c3
due to substitution of std::vector with osg::MixinVectors   (this
low level change prevents wrapper access to functions for building
arrays)
I also had to make some changes to build as reported in
http://code.google.com/p/osgswig/issues/detail?id=13

If interested, let me know

Luigi


Phan, Linh H ha scritto:

Hi,
   I'm having a real hard time compiling osgswig (gotten from
osgswig svn) for OpenSceneGraph 2.3.4 on Windows using MinGW
or cygwin.  The README said that it has been tested with
OpenSceneGraph 2.3.4.   Does anyone have a
pre-built Windows binary for osgswig that they can make
available?  I would really appreciate it.
 Thank you,
 Linh
  




___
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
  


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


Re: [osg-users] Compile error - ConvertUTF on osgDB in Cygwin

2008-11-14 Thread Robert Osfield
Hi Brian,

I have just reviewed Alberto's fix and I'm not happy with it as it
stands, I don't cygwin to test against so I can't test this myself,
but I do wonder if defining wstring ourselves for Cygwin would be a
workable solution i.e. add the following to ConvertUTF:

#ifdef __CYGWIN__
namespace std
{
typedef basic_string wstring;
}
#endif

I've attached a modified ConvertUTF.  Could you try this out in place
of Alberto's changes.  In theory you'll be able to revert to the svn
version of ConvertUTF.cpp as well is this works fine.

If this work I'll check this in.

Robert.


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


Re: [osg-users] Compile error - ConvertUTF on osgDB in Cygwin

2008-11-14 Thread Brian Keener
Alberto Luaces wrote:
> A patch sent this week is pending on the submissions queue to be applied. 
See 
> the osg-submissions list if you want to have OSG compiling now:
> 
> 
//www.mail-archive.com/[EMAIL PROTECTED]/msg02349.html
">http://www.mail-archive.com/[EMAIL PROTECTED]/msg023
49.html

Thanks Alberto,

The patch fixed it - compiled fine and the hangs still seem to be absent from 
the cygwin compile running the examples - this is good.  I did notice and 
seems I have noticed this before - from osgLauncher some of the processes 
(burning cessna, particles) end up hidden behind the osgLauncher screen.  
Some work fine but a few of these end up hidden and you think you have 
problem until you find them and sometimes they are hard to get to come to the 
front.  Might be just Cygwin but thought I would mention it in case others 
have noticed.


Thanks again 

bk



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


Re: [osg-users] Performance expectations

2008-11-14 Thread Jan Ciger
> On Thu, Nov 13, 2008 at 1:26 PM, Jan Ciger <[EMAIL PROTECTED]> wrote:
> Well, we have different projects at opposite ends of the
> performance/hardware continuum.  But for the hyper-framerates we use
> lots of low-power-dissipating GPUs.  Some (but not all) projects are
> described on http://www.zebraimaging.com/

Ah, holography :-p

Are you running something like this on a cluster of regular PCs stacked with 
GPUs or on custom hardware? These things have insane requirements for the 
amount of data to be rendered, even for offline display. 

Regards,

Jan


signature.asc
Description: This is a digitally signed message part.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] shaders in OSG...

2008-11-14 Thread Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Thrall,
Bryan
Sent: Friday, November 14, 2008 10:10 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] shaders in OSG...


>Do these crashes go away if you run OSG single-threaded? It sounds like
>you might be changing the scenegraph at a point where it isn't safe to
>do so. In general, it is safe to change the scenegraph from an update
>callback, but otherwise you could have problems. Also, if you are making
>changes to a StateSet, you should mark it as DYNAMIC. See also below.

I have not tried running OSG single threaded. I have tried the changes both
before I call osgviewer.run() and in an update callback after the render
loop is going. Both have caused crashes.

I have not tried marking the StateSet as DYNAMIC unless that is the default
setting. I will look into this.


>See osg::Switch; you could create two child nodes, one with an empty
>Program, the other with the shaders. Have them both make the actual
>scenegraph their child; then you can use the Switch to determine whether
>the fixed pipeline is used or not.

Thanks for this suggestion. I will look into this further...

-Shayne

> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Mike
> Weiblen
> Sent: Thursday, November 13, 2008 11:33 AM
> To: OpenSceneGraph Users
> Subject: Re: [osg-users] shaders in OSG...
> 
> The only way to turn off a glProgram in GL is glUseProgram(0), there
> is no glEnable/glDisable.
> 
> In OSG you do that by creating an "empty" osg::Program, one with no
> osg::Shaders attached.  Just attach that empty osg::Program where you
> want to revert to fixed-function.  Further details in
> http://mew.cx/osg_glsl_july2005.pdf
> 
> cheers
> -- mew
> 
> 
> 
> On Wed, Nov 12, 2008 at 2:55 PM, Tueller,  Shayne R Civ USAF AFMC 519
> SMXS/MXDEC <[EMAIL PROTECTED]> wrote:
>> Hello,
>> 
>> 
>> 
>> Is there a "light weight" way to turn off shaders in OSG without
unloading
>> the vertex and fragment shaders from the shader program?
>> 
>> 
>> 
>> My application needs to switch back and forth from the shader
pipeline to
>> the fixed pipeline and vice versa during runtime. This can be done at
the
>> OpenGL level by calling the function glUseProgramObject() to make the
quick
>> switch. Is there an equivalent in OpenSceneGraph?
>> 
>> 
>> 
>> Thanks in advance,
>> 
>> -Shayne
>> 
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>>
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or
g



-- 
Bryan Thrall
FlightSafety International
[EMAIL PROTECTED]
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


smime.p7s
Description: S/MIME cryptographic signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] unsigned int missing in osg::Uniform?

2008-11-14 Thread Mike Weiblen
Those enum were copied as a block from glext.h; GL_UNSIGNED_INT is in
gl.h.  Probably just an oversight.  Feel free to add and send to
osg-submissions.
-- mew


On Fri, Nov 14, 2008 at 5:18 AM, Ferdi Smit <[EMAIL PROTECTED]> wrote:
> It appears that support for a single unsigned int uniform is missing. In
> include
> /osg
> /Uniform
> 
> there is support for:
>
> UNSIGNED_INT_VEC2 = GL_UNSIGNED_INT_VEC2_EXT,
> UNSIGNED_INT_VEC3 = GL_UNSIGNED_INT_VEC3_EXT,
> UNSIGNED_INT_VEC4 = GL_UNSIGNED_INT_VEC4_EXT,
>
> but GL_UNSIGNED_INT is not there, if I am correct. Is there any reason for
> this, or is it by accident?
>
> --
> Regards,
>
> Ferdi Smit
> Email: [EMAIL PROTECTED]
> Room: C0.07  Phone: 4229
> INS3 Visualization and 3D Interfaces
> CWI Amsterdam, The Netherlands
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
Mike Weiblen -- Boulder Colorado USA -- http://mew.cx/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] shaders in OSG...

2008-11-14 Thread Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC
Mike,

Thanks for the reply. There was an exchange on this subject back on August
28 in the archives. I tried all the suggested solutions to the problem to no
avail. I have tried binding to an "empty" program as you suggest by using
the call ss->SetAttributesAndModes(new osg::Program()) which does indeed
turn off the shader (back to fixed functionality). But when I attempt to
switch back to the shader with another call to
ss->SetAttributesAndModes(MyShaderProgram), it crashes my OpenSceneGraph
app.

I've tried the other suggestions such as removing the shaders from the
program and then adding them back on for enable/disable and also the call
ss->RemoveAttribute(MyShaderProgram) which have also caused a crash on the
ensuing call ss->SetAttributesAndModes(MyShaderProgram). The only mechanism
that has worked cleanly for me is if I create two programs, one that is
empty and one that has my vertex/fragment shaders attached. When I call each
programs "apply" method to switch the shaders off and on, this seems to
work. I'm not sure if this the correct way to do it though.

I've also noticed that there is no clean way of switching between multiple
programs attached to a single object during runtime. At least I haven't
found a way to get it to work in OSG. In OpenGL, I've always been able to
have multiple programs that I can swap in and out via the call to
glUseProgram() with the appropriate program handle (including the call
glUseProgram(0) to switch to the fixed pipe). I don't see an equivalent
mechanism in OpenSceneGraph to achieve the same functionality.

If you or anyone else can enlighten me, it would be most appreciated...

-Shayne

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mike
Weiblen
Sent: Thursday, November 13, 2008 11:33 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] shaders in OSG...

The only way to turn off a glProgram in GL is glUseProgram(0), there
is no glEnable/glDisable.

In OSG you do that by creating an "empty" osg::Program, one with no
osg::Shaders attached.  Just attach that empty osg::Program where you
want to revert to fixed-function.  Further details in
http://mew.cx/osg_glsl_july2005.pdf

cheers
-- mew



On Wed, Nov 12, 2008 at 2:55 PM, Tueller,  Shayne R Civ USAF AFMC 519
SMXS/MXDEC <[EMAIL PROTECTED]> wrote:
> Hello,
>
>
>
> Is there a "light weight" way to turn off shaders in OSG without unloading
> the vertex and fragment shaders from the shader program?
>
>
>
> My application needs to switch back and forth from the shader pipeline to
> the fixed pipeline and vice versa during runtime. This can be done at the
> OpenGL level by calling the function glUseProgramObject() to make the
quick
> switch. Is there an equivalent in OpenSceneGraph?
>
>
>
> Thanks in advance,
>
> -Shayne
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>



-- 
Mike Weiblen -- Boulder Colorado USA -- http://mew.cx/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


smime.p7s
Description: S/MIME cryptographic signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] shaders in OSG...

2008-11-14 Thread Mike Weiblen
hmm, I was unaware of crash bugs in Program switching.  If you could
create a simple repro, I'd be interested.
-- mew


On Fri, Nov 14, 2008 at 9:48 AM, Tueller,  Shayne R Civ USAF AFMC 519
SMXS/MXDEC <[EMAIL PROTECTED]> wrote:
> Mike,
>
> Thanks for the reply. There was an exchange on this subject back on August
> 28 in the archives. I tried all the suggested solutions to the problem to no
> avail. I have tried binding to an "empty" program as you suggest by using
> the call ss->SetAttributesAndModes(new osg::Program()) which does indeed
> turn off the shader (back to fixed functionality). But when I attempt to
> switch back to the shader with another call to
> ss->SetAttributesAndModes(MyShaderProgram), it crashes my OpenSceneGraph
> app.
>
> I've tried the other suggestions such as removing the shaders from the
> program and then adding them back on for enable/disable and also the call
> ss->RemoveAttribute(MyShaderProgram) which have also caused a crash on the
> ensuing call ss->SetAttributesAndModes(MyShaderProgram). The only mechanism
> that has worked cleanly for me is if I create two programs, one that is
> empty and one that has my vertex/fragment shaders attached. When I call each
> programs "apply" method to switch the shaders off and on, this seems to
> work. I'm not sure if this the correct way to do it though.
>
> I've also noticed that there is no clean way of switching between multiple
> programs attached to a single object during runtime. At least I haven't
> found a way to get it to work in OSG. In OpenGL, I've always been able to
> have multiple programs that I can swap in and out via the call to
> glUseProgram() with the appropriate program handle (including the call
> glUseProgram(0) to switch to the fixed pipe). I don't see an equivalent
> mechanism in OpenSceneGraph to achieve the same functionality.
>
> If you or anyone else can enlighten me, it would be most appreciated...
>
> -Shayne
>
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Mike
> Weiblen
> Sent: Thursday, November 13, 2008 11:33 AM
> To: OpenSceneGraph Users
> Subject: Re: [osg-users] shaders in OSG...
>
> The only way to turn off a glProgram in GL is glUseProgram(0), there
> is no glEnable/glDisable.
>
> In OSG you do that by creating an "empty" osg::Program, one with no
> osg::Shaders attached.  Just attach that empty osg::Program where you
> want to revert to fixed-function.  Further details in
> http://mew.cx/osg_glsl_july2005.pdf
>
> cheers
> -- mew
>
>
>
> On Wed, Nov 12, 2008 at 2:55 PM, Tueller,  Shayne R Civ USAF AFMC 519
> SMXS/MXDEC <[EMAIL PROTECTED]> wrote:
>> Hello,
>>
>>
>>
>> Is there a "light weight" way to turn off shaders in OSG without unloading
>> the vertex and fragment shaders from the shader program?
>>
>>
>>
>> My application needs to switch back and forth from the shader pipeline to
>> the fixed pipeline and vice versa during runtime. This can be done at the
>> OpenGL level by calling the function glUseProgramObject() to make the
> quick
>> switch. Is there an equivalent in OpenSceneGraph?
>>
>>
>>
>> Thanks in advance,
>>
>> -Shayne
>>
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>>
>
>
>
> --
> Mike Weiblen -- Boulder Colorado USA -- http://mew.cx/
> ___
> 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
>
>



-- 
Mike Weiblen -- Boulder Colorado USA -- http://mew.cx/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] osgswig cmake problem

2008-11-14 Thread Patrick Bouffard
Gerwin,

Thanks! That got me a lot farther:

[EMAIL PROTECTED]:~/dev/osgswig-read-only/build$ make
/usr/bin/cmake -H/home/patrick/dev/osgswig-read-only
-B/home/patrick/dev/osgswig-read-only/build --check-build-system
CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start
/home/patrick/dev/osgswig-read-only/build/CMakeFiles
/home/patrick/dev/osgswig-read-only/build/CMakeFiles/progress.make
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory `/home/patrick/dev/osgswig-read-only/build'
make -f src/python/CMakeFiles/_osg.dir/build.make
src/python/CMakeFiles/_osg.dir/depend
make[2]: Entering directory `/home/patrick/dev/osgswig-read-only/build'
/usr/bin/cmake -E cmake_progress_report
/home/patrick/dev/osgswig-read-only/build/CMakeFiles 2
[  2%] Swig source
cd /home/patrick/dev/osgswig-read-only/build/src/python &&
/usr/bin/swig -python -make_default -outdir
/home/patrick/dev/osgswig-read-only/build/lib/python -c++
-I/usr/include -I/home/patrick/dev/osgswig-read-only/include
-I/usr/include/python2.5 -o
/home/patrick/dev/osgswig-read-only/build/src/python/osgPYTHON_wrap.cxx
/home/patrick/dev/osgswig-read-only/src/python//osg.i
/home/patrick/dev/osgswig-read-only/src/python//../GL.i:70:
Warning(302): Identifier 'GL_FLOAT' redefined (ignored),
/home/patrick/dev/osgswig-read-only/src/python//../GL.i:28:
Warning(302): previous definition of 'GL_FLOAT'.
/home/patrick/dev/osgswig-read-only/src/python//../GL.i:74:
Warning(302): Identifier 'GL_DOUBLE' redefined (ignored),
/home/patrick/dev/osgswig-read-only/src/python//../GL.i:29:
Warning(302): previous definition of 'GL_DOUBLE'.
/usr/include/osg/Referenced:112: Warning(302): Identifier
'~Referenced' redefined by %extend (ignored),
/home/patrick/dev/osgswig-read-only/src/python//../osg.i:478:
Warning(302): %extend definition of '~Referenced'.
...
[  4%] Building CXX object src/python/CMakeFiles/_osg.dir/osgPYTHON_wrap.cxx.o
cd /home/patrick/dev/osgswig-read-only/build/src/python &&
/usr/bin/c++-D_osg_EXPORTS -O2 -fPIC
-I/home/patrick/dev/osgswig-read-only/include -I/usr/include/python2.5
  -o CMakeFiles/_osg.dir/osgPYTHON_wrap.cxx.o -c
/home/patrick/dev/osgswig-read-only/build/src/python/osgPYTHON_wrap.cxx
/home/patrick/dev/osgswig-read-only/build/src/python/osgPYTHON_wrap.cxx:
In function 'PyObject* _wrap_new_Vec2dArray__SWIG_0(PyObject*,
PyObject*)':
/home/patrick/dev/osgswig-read-only/build/src/python/osgPYTHON_wrap.cxx:146392:
error: 'Vec2dArrayType' is not a member of 'osg::Array'
/home/patrick/dev/osgswig-read-only/build/src/python/osgPYTHON_wrap.cxx:146392:
error: 'Vec2dArrayType' is not a member of 'osg::Array'
/home/patrick/dev/osgswig-read-only/build/src/python/osgPYTHON_wrap.cxx:146392:
error: template argument 2 is invalid
/home/patrick/dev/osgswig-read-only/build/src/python/osgPYTHON_wrap.cxx:146392:
error: invalid type in declaration before '=' token
/home/patrick/dev/osgswig-read-only/build/src/python/osgPYTHON_wrap.cxx:146397:
error: 'Vec2dArrayType' is not a member of 'osg::Array'
/home/patrick/dev/osgswig-read-only/build/src/python/osgPYTHON_wrap.cxx:146397:
error: 'Vec2dArrayType' is not a member of 'osg::Array'
/home/patrick/dev/osgswig-read-only/build/src/python/osgPYTHON_wrap.cxx:146397:
error: template argument 2 is invalid
/home/patrick/dev/osgswig-read-only/build/src/python/osgPYTHON_wrap.cxx:146397:
error: expected primary-expression before ')' token
/home/patrick/dev/osgswig-read-only/build/src/python/osgPYTHON_wrap.cxx:146397:
error: expected `;' before 'new'
/home/patrick/dev/osgswig-read-only/build/src/python/osgPYTHON_wrap.cxx:146405:
error: request for member 'ref' in '* result', which is of non-class
type 'int'
/home/patrick/dev/osgswig-read-only/build/src/python/osgPYTHON_wrap.cxx:
In function 'PyObject* _wrap_new_Vec2dArray__SWIG_1(PyObject*,
PyObject*)':
/home/patrick/dev/osgswig-read-only/build/src/python/osgPYTHON_wrap.cxx:146418:
error: 'Vec2dArrayType' is not a member of 'osg::Array'
/home/patrick/dev/osgswig-read-only/build/src/python/osgPYTHON_wrap.cxx:146418:
error: 'Vec2dArrayType' is not a member of 'osg::Array'
/home/patrick/dev/osgswig-read-only/build/src/python/osgPYTHON_wrap.cxx:146418:
error: template argument 2 is invalid
... lots more like this ...
/home/patrick/dev/osgswig-read-only/build/src/python/osgPYTHON_wrap.cxx:
In function 'void*
_p_osg__TemplateArrayTosg__Vec4d_osg__Array__Vec4dArrayType_4_0x140A_tTo_p_std__vectorTosg__Vec4d_std__allocatorTosg__Vec4d_t_t(void*)':
/home/patrick/dev/osgswig-read-only/build/src/python/osgPYTHON_wrap.cxx:328082:
error: 'Vec4dArrayType' is not a member of 'osg::Array'
/home/patrick/dev/osgswig-read-only/build/src/python/osgPYTHON_wrap.cxx:328082:
error: 'Vec4dArrayType' is not a member of 'osg::Array'
/home/patrick/dev/osgswig-read-only/build/src/python/osgPYTHON_wrap.cxx:328082:
error: template argument 2 is invalid
/home/patrick/dev/osgswig-read-only/build/src/python/osgPYTHON_wrap.cxx:328082:
error: expected primary-expression before 'void'
/home/patrick

Re: [osg-users] shaders in OSG...

2008-11-14 Thread Thrall, Bryan
Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC wrote on Friday, November
14, 2008 10:49 AM:

> Mike,
> 
> Thanks for the reply. There was an exchange on this subject back on
August
> 28 in the archives. I tried all the suggested solutions to the problem
to no
> avail. I have tried binding to an "empty" program as you suggest by
using
> the call ss->SetAttributesAndModes(new osg::Program()) which does
indeed
> turn off the shader (back to fixed functionality). But when I attempt
to
> switch back to the shader with another call to
> ss->SetAttributesAndModes(MyShaderProgram), it crashes my
OpenSceneGraph
> app.
> 
> I've tried the other suggestions such as removing the shaders from the
> program and then adding them back on for enable/disable and also the
call
> ss->RemoveAttribute(MyShaderProgram) which have also caused a crash on
the
> ensuing call ss->SetAttributesAndModes(MyShaderProgram). The only
mechanism
> that has worked cleanly for me is if I create two programs, one that
is
> empty and one that has my vertex/fragment shaders attached. When I
call each
> programs "apply" method to switch the shaders off and on, this seems
to
> work. I'm not sure if this the correct way to do it though.

Do these crashes go away if you run OSG single-threaded? It sounds like
you might be changing the scenegraph at a point where it isn't safe to
do so. In general, it is safe to change the scenegraph from an update
callback, but otherwise you could have problems. Also, if you are making
changes to a StateSet, you should mark it as DYNAMIC. See also below.

> I've also noticed that there is no clean way of switching between
multiple
> programs attached to a single object during runtime. At least I
haven't
> found a way to get it to work in OSG. In OpenGL, I've always been able
to
> have multiple programs that I can swap in and out via the call to
> glUseProgram() with the appropriate program handle (including the call
> glUseProgram(0) to switch to the fixed pipe). I don't see an
equivalent
> mechanism in OpenSceneGraph to achieve the same functionality.
> 
> If you or anyone else can enlighten me, it would be most
appreciated...

See osg::Switch; you could create two child nodes, one with an empty
Program, the other with the shaders. Have them both make the actual
scenegraph their child; then you can use the Switch to determine whether
the fixed pipeline is used or not.

> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Mike
> Weiblen
> Sent: Thursday, November 13, 2008 11:33 AM
> To: OpenSceneGraph Users
> Subject: Re: [osg-users] shaders in OSG...
> 
> The only way to turn off a glProgram in GL is glUseProgram(0), there
> is no glEnable/glDisable.
> 
> In OSG you do that by creating an "empty" osg::Program, one with no
> osg::Shaders attached.  Just attach that empty osg::Program where you
> want to revert to fixed-function.  Further details in
> http://mew.cx/osg_glsl_july2005.pdf
> 
> cheers
> -- mew
> 
> 
> 
> On Wed, Nov 12, 2008 at 2:55 PM, Tueller,  Shayne R Civ USAF AFMC 519
> SMXS/MXDEC <[EMAIL PROTECTED]> wrote:
>> Hello,
>> 
>> 
>> 
>> Is there a "light weight" way to turn off shaders in OSG without
unloading
>> the vertex and fragment shaders from the shader program?
>> 
>> 
>> 
>> My application needs to switch back and forth from the shader
pipeline to
>> the fixed pipeline and vice versa during runtime. This can be done at
the
>> OpenGL level by calling the function glUseProgramObject() to make the
quick
>> switch. Is there an equivalent in OpenSceneGraph?
>> 
>> 
>> 
>> Thanks in advance,
>> 
>> -Shayne
>> 
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>>
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or
g



-- 
Bryan Thrall
FlightSafety International
[EMAIL PROTECTED]
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Performance expectations

2008-11-14 Thread Mike Weiblen
On Thu, Nov 13, 2008 at 1:26 PM, Jan Ciger <[EMAIL PROTECTED]> wrote:
>> Oh good... a brother in misery hardware is a big factor in our work
>> as well.
>>
>> Ed
>>
>> Mike Weiblen wrote:
>> > Just as another general datapoint, and not OSG-specific, we also have
>> > requirements for rendering framerates in excess of 10's of kilohertz.
>> > Likewise, I cant discuss details, other than we do throw a lot of
>> > hardware in that direction.
>> >
>> > -- mew
>
> Guys, just out of sheer curiosity - what kind of HW is needed to generate such
> framerates? If you cannot talk about specifics, at least a ballpark idea would
> be cool to know.
>
> Regards,
>
> Jan

Well, we have different projects at opposite ends of the
performance/hardware continuum.  But for the hyper-framerates we use
lots of low-power-dissipating GPUs.  Some (but not all) projects are
described on http://www.zebraimaging.com/

cheers
-- mew




-- 
Mike Weiblen -- Boulder Colorado USA -- http://mew.cx/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgswig cmake problem

2008-11-14 Thread Gerwin de Haan
Well, it appears this is (still) wrong in SVN. I'll get to that. For now,
please change row ~503 in src/osg.i to:

#if (OPENSCENEGRAPH_SO_VERSION > 41)
%include 
#endif

Gerwin

ps. could you submit osgswig bugs in the osgswig google code site as well so
we can track changes and all?
ps2. could you and other osgswig users report to me that they are using it?
We'd love to keep track and demonstrate of its use, especially because this
attracts other users and developers.

On Fri, Nov 14, 2008 at 5:12 PM, Patrick Bouffard <
[EMAIL PROTECTED]> wrote:

> Thanks Gerrick. Actually after posting I thought about it some more
> and got a bit farther. What I needed to do was install some more
> packages (libopenthreads-dev and libopenscenegraph-dev). Now cmake
> completes successfully and my problem is with make:
>
> /usr/bin/cmake -H/home/patrick/dev/osgswig-read-only
> -B/home/patrick/dev/osgswig-read-only/build --check-build-system
> CMakeFiles/Makefile.cmake 0
> /usr/bin/cmake -E cmake_progress_start
> /home/patrick/dev/osgswig-read-only/build/CMakeFiles
> /home/patrick/dev/osgswig-read-only/build/CMakeFiles/progress.make
> make -f CMakeFiles/Makefile2 all
> make[1]: Entering directory `/home/patrick/dev/osgswig-read-only/build'
> make -f src/python/CMakeFiles/_osg.dir/build.make
> src/python/CMakeFiles/_osg.dir/depend
> make[2]: Entering directory `/home/patrick/dev/osgswig-read-only/build'
> /usr/bin/cmake -E cmake_progress_report
> /home/patrick/dev/osgswig-read-only/build/CMakeFiles 2
> [  2%] Swig source
> cd /home/patrick/dev/osgswig-read-only/build/src/python &&
> /usr/bin/swig -python -make_default -outdir
> /home/patrick/dev/osgswig-read-only/build/lib/python -c++
> -I/usr/include -I/home/patrick/dev/osgswig-read-only/include
> -I/usr/include/python2.5 -o
> /home/patrick/dev/osgswig-read-only/build/src/python/osgPYTHON_wrap.cxx
> /home/patrick/dev/osgswig-read-only/src/python//osg.i
> /home/patrick/dev/osgswig-read-only/src/python//../osg.i:503: Error:
> Unable to find 'osg/MixinVector'
> make[2]: *** [src/python/osgPYTHON_wrap.cxx] Error 1
> make[2]: Leaving directory `/home/patrick/dev/osgswig-read-only/build'
> make[1]: *** [src/python/CMakeFiles/_osg.dir/all] Error 2
> make[1]: Leaving directory `/home/patrick/dev/osgswig-read-only/build'
> make: *** [all] Error 2
>
>
> >
> > On Fri, Nov 14, 2008 at 11:02 AM, Gerrick Bivins
> > <[EMAIL PROTECTED]> wrote:
> >> Hi Patrick,
> >> Those variables have to be defined by the user so osgswig knows where
> your
> >> OSG is installed.
> >> If you run ccmake like so:
> >>
> >>  >mkdir build
> >>  >cd build
> >>  >ccmake ../
> >>
> >>  you can set these variables to point to the correct location in the
> >> interface.
> >> I'm sure there is a way to define them via command line cmake, but I use
> >> either the GUI for cmake on win or ccmake on linux/mac so someone else
> would
> >> have to tell you how.
> >> Gerrick
> >>
> >>
> >> On 11/14/08 9:43 AM, "Patrick Bouffard" <[EMAIL PROTECTED]>
> >> wrote:
> >>
> >>> Hi, I have OSG 2.4 installed via apt-get on my ubuntu 8.04 system. I
> fetched
> >>> osgswig from svn and did as per the README:
> >>>
> >>> mkdir build
> >>> cd build
> >>> cmake ..  -DCMAKE_BUILD_TYPE=Release
> >>>
> >>> .. and get:
> >>>
> >>> -- Warning osg not found, OSG_LIBRARY tring to use: OSG_LIBRARY_DEBUG
> >>> -- Warning osgUtil not found, OSGUTIL_LIBRARY tring to use:
> >>> OSGUTIL_LIBRARY_DEBUG
> >>> -- Warning osgDB not found, OSGDB_LIBRARY tring to use:
> OSGDB_LIBRARY_DEBUG
> >>> -- Warning osgText not found, OSGTEXT_LIBRARY tring to use:
> >>> OSGTEXT_LIBRARY_DEBUG
> >>> -- Warning osgTerrain not found, OSGTERRAIN_LIBRARY tring to use:
> >>> OSGTERRAIN_LIBRARY_DEBUG
> >>> -- Warning osgFX not found, OSGFX_LIBRARY tring to use:
> OSGFX_LIBRARY_DEBUG
> >>> -- Warning osgViewer not found, OSGVIEWER_LIBRARY tring to use:
> >>>
> >>> OSGVIEWER_LIBRARY_DEBUG
> >>> -- Warning osgGA not found, OSGGA_LIBRARY tring to use:
> OSGGA_LIBRARY_DEBUG
> >>> -- Warning osgSim not found, OSGSIM_LIBRARY tring to use:
> OSGSIM_LIBRARY_DEBUG
> >>> -- Warning osgShadow not found, OSGSHADOW_LIBRARY tring to use:
> >>>
> >>> OSGSHADOW_LIBRARY_DEBUG
> >>> -- Warning osgManipulator not found, OSGMANIPULATOR_LIBRARY tring to
> use:
> >>> OSGMANIPULATOR_LIBRARY_DEBUG
> >>> -- Warning osgParticle not found, OSGPARTICLE_LIBRARY tring to use:
> >>>
> >>> OSGPARTICLE_LIBRARY_DEBUG
> >>> CMake Error: The following variables are used in this project, but they
> are
> >>> set
> >>>
> >>> to NOTFOUND.
> >>> Please set them or make sure they are set and tested correctly in the
> CMake
> >>> files:
> >>> OPENTHREADS_LIBRARY (ADVANCED)
> >>> linked by target "_osg" in directory
> >>> /home/patrick/dev/osgswig-read-only/src/python
> >>> linked by target "_osgDB" in directory
> >>> /home/patrick/dev/osgswig-read-only/src/python
> >>> linked by target "_osgFX" in directory
> >>> /home/patrick/dev/osgswig-read-only/src/python
> >>> linked by target "_osgGA" in direc

Re: [osg-users] osgswig cmake problem

2008-11-14 Thread Patrick Bouffard
Thanks Gerrick. Actually after posting I thought about it some more
and got a bit farther. What I needed to do was install some more
packages (libopenthreads-dev and libopenscenegraph-dev). Now cmake
completes successfully and my problem is with make:

/usr/bin/cmake -H/home/patrick/dev/osgswig-read-only
-B/home/patrick/dev/osgswig-read-only/build --check-build-system
CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start
/home/patrick/dev/osgswig-read-only/build/CMakeFiles
/home/patrick/dev/osgswig-read-only/build/CMakeFiles/progress.make
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory `/home/patrick/dev/osgswig-read-only/build'
make -f src/python/CMakeFiles/_osg.dir/build.make
src/python/CMakeFiles/_osg.dir/depend
make[2]: Entering directory `/home/patrick/dev/osgswig-read-only/build'
/usr/bin/cmake -E cmake_progress_report
/home/patrick/dev/osgswig-read-only/build/CMakeFiles 2
[  2%] Swig source
cd /home/patrick/dev/osgswig-read-only/build/src/python &&
/usr/bin/swig -python -make_default -outdir
/home/patrick/dev/osgswig-read-only/build/lib/python -c++
-I/usr/include -I/home/patrick/dev/osgswig-read-only/include
-I/usr/include/python2.5 -o
/home/patrick/dev/osgswig-read-only/build/src/python/osgPYTHON_wrap.cxx
/home/patrick/dev/osgswig-read-only/src/python//osg.i
/home/patrick/dev/osgswig-read-only/src/python//../osg.i:503: Error:
Unable to find 'osg/MixinVector'
make[2]: *** [src/python/osgPYTHON_wrap.cxx] Error 1
make[2]: Leaving directory `/home/patrick/dev/osgswig-read-only/build'
make[1]: *** [src/python/CMakeFiles/_osg.dir/all] Error 2
make[1]: Leaving directory `/home/patrick/dev/osgswig-read-only/build'
make: *** [all] Error 2


>
> On Fri, Nov 14, 2008 at 11:02 AM, Gerrick Bivins
> <[EMAIL PROTECTED]> wrote:
>> Hi Patrick,
>> Those variables have to be defined by the user so osgswig knows where your
>> OSG is installed.
>> If you run ccmake like so:
>>
>>  >mkdir build
>>  >cd build
>>  >ccmake ../
>>
>>  you can set these variables to point to the correct location in the
>> interface.
>> I'm sure there is a way to define them via command line cmake, but I use
>> either the GUI for cmake on win or ccmake on linux/mac so someone else would
>> have to tell you how.
>> Gerrick
>>
>>
>> On 11/14/08 9:43 AM, "Patrick Bouffard" <[EMAIL PROTECTED]>
>> wrote:
>>
>>> Hi, I have OSG 2.4 installed via apt-get on my ubuntu 8.04 system. I fetched
>>> osgswig from svn and did as per the README:
>>>
>>> mkdir build
>>> cd build
>>> cmake ..  -DCMAKE_BUILD_TYPE=Release
>>>
>>> .. and get:
>>>
>>> -- Warning osg not found, OSG_LIBRARY tring to use: OSG_LIBRARY_DEBUG
>>> -- Warning osgUtil not found, OSGUTIL_LIBRARY tring to use:
>>> OSGUTIL_LIBRARY_DEBUG
>>> -- Warning osgDB not found, OSGDB_LIBRARY tring to use: OSGDB_LIBRARY_DEBUG
>>> -- Warning osgText not found, OSGTEXT_LIBRARY tring to use:
>>> OSGTEXT_LIBRARY_DEBUG
>>> -- Warning osgTerrain not found, OSGTERRAIN_LIBRARY tring to use:
>>> OSGTERRAIN_LIBRARY_DEBUG
>>> -- Warning osgFX not found, OSGFX_LIBRARY tring to use: OSGFX_LIBRARY_DEBUG
>>> -- Warning osgViewer not found, OSGVIEWER_LIBRARY tring to use:
>>>
>>> OSGVIEWER_LIBRARY_DEBUG
>>> -- Warning osgGA not found, OSGGA_LIBRARY tring to use: OSGGA_LIBRARY_DEBUG
>>> -- Warning osgSim not found, OSGSIM_LIBRARY tring to use: 
>>> OSGSIM_LIBRARY_DEBUG
>>> -- Warning osgShadow not found, OSGSHADOW_LIBRARY tring to use:
>>>
>>> OSGSHADOW_LIBRARY_DEBUG
>>> -- Warning osgManipulator not found, OSGMANIPULATOR_LIBRARY tring to use:
>>> OSGMANIPULATOR_LIBRARY_DEBUG
>>> -- Warning osgParticle not found, OSGPARTICLE_LIBRARY tring to use:
>>>
>>> OSGPARTICLE_LIBRARY_DEBUG
>>> CMake Error: The following variables are used in this project, but they are
>>> set
>>>
>>> to NOTFOUND.
>>> Please set them or make sure they are set and tested correctly in the CMake
>>> files:
>>> OPENTHREADS_LIBRARY (ADVANCED)
>>> linked by target "_osg" in directory
>>> /home/patrick/dev/osgswig-read-only/src/python
>>> linked by target "_osgDB" in directory
>>> /home/patrick/dev/osgswig-read-only/src/python
>>> linked by target "_osgFX" in directory
>>> /home/patrick/dev/osgswig-read-only/src/python
>>> linked by target "_osgGA" in directory
>>> /home/patrick/dev/osgswig-read-only/src/python
>>> linked by target "_osgManipulator" in directory
>>> /home/patrick/dev/osgswig-read-only/src/python
>>> linked by target "_osgSim" in directory
>>> /home/patrick/dev/osgswig-read-only/src/python
>>> linked by target "_osgText" in directory
>>> /home/patrick/dev/osgswig-read-only/src/python
>>> linked by target "_osgUtil" in directory
>>> /home/patrick/dev/osgswig-read-only/src/python
>>> linked by target "_osgViewer" in directory
>>> /home/patrick/dev/osgswig-read-only/src/python
>>> OSGDB_LIBRARY
>>> linked by target "_osgDB" in directory
>>> /home/patrick/dev/osgswig-read-only/src/python
>>> linked by target "_osgFX" in directory
>>> /home/patrick/dev/osgswig-read-only/src/p

Re: [osg-users] osgswig cmake problem

2008-11-14 Thread Gerrick Bivins
Hi Patrick,
Those variables have to be defined by the user so osgswig knows where your
OSG is installed.
If you run ccmake like so:

 >mkdir build
 >cd build
 >ccmake ../

 you can set these variables to point to the correct location in the
interface. 
I'm sure there is a way to define them via command line cmake, but I use
either the GUI for cmake on win or ccmake on linux/mac so someone else would
have to tell you how.
Gerrick


On 11/14/08 9:43 AM, "Patrick Bouffard" <[EMAIL PROTECTED]>
wrote:

> Hi, I have OSG 2.4 installed via apt-get on my ubuntu 8.04 system. I fetched
> osgswig from svn and did as per the README:
> 
> mkdir build
> cd build 
> cmake ..  -DCMAKE_BUILD_TYPE=Release
> 
> .. and get:
> 
> -- Warning osg not found, OSG_LIBRARY tring to use: OSG_LIBRARY_DEBUG
> -- Warning osgUtil not found, OSGUTIL_LIBRARY tring to use:
> OSGUTIL_LIBRARY_DEBUG
> -- Warning osgDB not found, OSGDB_LIBRARY tring to use: OSGDB_LIBRARY_DEBUG
> -- Warning osgText not found, OSGTEXT_LIBRARY tring to use:
> OSGTEXT_LIBRARY_DEBUG
> -- Warning osgTerrain not found, OSGTERRAIN_LIBRARY tring to use:
> OSGTERRAIN_LIBRARY_DEBUG
> -- Warning osgFX not found, OSGFX_LIBRARY tring to use: OSGFX_LIBRARY_DEBUG
> -- Warning osgViewer not found, OSGVIEWER_LIBRARY tring to use:
> 
> OSGVIEWER_LIBRARY_DEBUG
> -- Warning osgGA not found, OSGGA_LIBRARY tring to use: OSGGA_LIBRARY_DEBUG
> -- Warning osgSim not found, OSGSIM_LIBRARY tring to use: OSGSIM_LIBRARY_DEBUG
> -- Warning osgShadow not found, OSGSHADOW_LIBRARY tring to use:
> 
> OSGSHADOW_LIBRARY_DEBUG
> -- Warning osgManipulator not found, OSGMANIPULATOR_LIBRARY tring to use:
> OSGMANIPULATOR_LIBRARY_DEBUG
> -- Warning osgParticle not found, OSGPARTICLE_LIBRARY tring to use:
> 
> OSGPARTICLE_LIBRARY_DEBUG
> CMake Error: The following variables are used in this project, but they are
> set
> 
> to NOTFOUND.
> Please set them or make sure they are set and tested correctly in the CMake
> files:
> OPENTHREADS_LIBRARY (ADVANCED)
> linked by target "_osg" in directory
> /home/patrick/dev/osgswig-read-only/src/python
> linked by target "_osgDB" in directory
> /home/patrick/dev/osgswig-read-only/src/python
> linked by target "_osgFX" in directory
> /home/patrick/dev/osgswig-read-only/src/python
> linked by target "_osgGA" in directory
> /home/patrick/dev/osgswig-read-only/src/python
> linked by target "_osgManipulator" in directory
> /home/patrick/dev/osgswig-read-only/src/python
> linked by target "_osgSim" in directory
> /home/patrick/dev/osgswig-read-only/src/python
> linked by target "_osgText" in directory
> /home/patrick/dev/osgswig-read-only/src/python
> linked by target "_osgUtil" in directory
> /home/patrick/dev/osgswig-read-only/src/python
> linked by target "_osgViewer" in directory
> /home/patrick/dev/osgswig-read-only/src/python
> OSGDB_LIBRARY
> linked by target "_osgDB" in directory
> /home/patrick/dev/osgswig-read-only/src/python
> linked by target "_osgFX" in directory
> /home/patrick/dev/osgswig-read-only/src/python
> OSGFX_LIBRARY
> linked by target "_osgFX" in directory
> /home/patrick/dev/osgswig-read-only/src/python
> OSGGA_LIBRARY
> linked by target "_osgGA" in directory
> /home/patrick/dev/osgswig-read-only/src/python
> linked by target "_osgManipulator" in directory
> /home/patrick/dev/osgswig-read-only/src/python
> linked by target "_osgSim" in directory
> /home/patrick/dev/osgswig-read-only/src/python
> linked by target "_osgText" in directory
> /home/patrick/dev/osgswig-read-only/src/python
> linked by target "_osgViewer" in directory
> /home/patrick/dev/osgswig-read-only/src/python
> OSGMANIPULATOR_LIBRARY
> linked by target "_osgManipulator" in directory
> /home/patrick/dev/osgswig-read-only/src/python
> OSGSIM_LIBRARY
> linked by target "_osgSim" in directory
> /home/patrick/dev/osgswig-read-only/src/python
> OSGTEXT_LIBRARY
> linked by target "_osgText" in directory
> /home/patrick/dev/osgswig-read-only/src/python
> OSGUTIL_LIBRARY
> linked by target "_osgFX" in directory
> /home/patrick/dev/osgswig-read-only/src/python
> linked by target "_osgManipulator" in directory
> /home/patrick/dev/osgswig-read-only/src/python
> linked by target "_osgSim" in directory
> /home/patrick/dev/osgswig-read-only/src/python
> linked by target "_osgUtil" in directory
> /home/patrick/dev/osgswig-read-only/src/python
> OSGVIEWER_LIBRARY
> linked by target "_osgViewer" in directory
> /home/patrick/dev/osgswig-read-only/src/python
> OSG_INCLUDE_DIR
>used as include directory in directory /home/patrick/dev/osgswig-read-only
>used as include directory in directory
> /home/patrick/dev/osgswig-read-only/src
>used as include directory in directory
> /home/patrick/dev/osgswig-read-only/src/python
> OSG_LIBRARY
> linked by target "_osg" in directory
> /home/patrick/dev/osgswig-read-only/src/python
> linked by target "_osgDB" in directory
> /home/patrick/dev/osgsw

[osg-users] osgswig cmake problem

2008-11-14 Thread Patrick Bouffard
Hi, I have OSG 2.4 installed via apt-get on my ubuntu 8.04 system. I fetched
osgswig from svn and did as per the README:

mkdir build
cd build 
cmake ..  -DCMAKE_BUILD_TYPE=Release

.. and get:

-- Warning osg not found, OSG_LIBRARY tring to use: OSG_LIBRARY_DEBUG
-- Warning osgUtil not found, OSGUTIL_LIBRARY tring to use: 
OSGUTIL_LIBRARY_DEBUG
-- Warning osgDB not found, OSGDB_LIBRARY tring to use: OSGDB_LIBRARY_DEBUG
-- Warning osgText not found, OSGTEXT_LIBRARY tring to use: 
OSGTEXT_LIBRARY_DEBUG
-- Warning osgTerrain not found, OSGTERRAIN_LIBRARY tring to use:
OSGTERRAIN_LIBRARY_DEBUG
-- Warning osgFX not found, OSGFX_LIBRARY tring to use: OSGFX_LIBRARY_DEBUG
-- Warning osgViewer not found, OSGVIEWER_LIBRARY tring to use:

OSGVIEWER_LIBRARY_DEBUG
-- Warning osgGA not found, OSGGA_LIBRARY tring to use: OSGGA_LIBRARY_DEBUG
-- Warning osgSim not found, OSGSIM_LIBRARY tring to use: OSGSIM_LIBRARY_DEBUG
-- Warning osgShadow not found, OSGSHADOW_LIBRARY tring to use:

OSGSHADOW_LIBRARY_DEBUG
-- Warning osgManipulator not found, OSGMANIPULATOR_LIBRARY tring to use:
OSGMANIPULATOR_LIBRARY_DEBUG
-- Warning osgParticle not found, OSGPARTICLE_LIBRARY tring to use:

OSGPARTICLE_LIBRARY_DEBUG
CMake Error: The following variables are used in this project, but they are set

to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake 
files:
OPENTHREADS_LIBRARY (ADVANCED)
linked by target "_osg" in directory
/home/patrick/dev/osgswig-read-only/src/python
linked by target "_osgDB" in directory
/home/patrick/dev/osgswig-read-only/src/python
linked by target "_osgFX" in directory
/home/patrick/dev/osgswig-read-only/src/python
linked by target "_osgGA" in directory
/home/patrick/dev/osgswig-read-only/src/python
linked by target "_osgManipulator" in directory
/home/patrick/dev/osgswig-read-only/src/python
linked by target "_osgSim" in directory
/home/patrick/dev/osgswig-read-only/src/python
linked by target "_osgText" in directory
/home/patrick/dev/osgswig-read-only/src/python
linked by target "_osgUtil" in directory
/home/patrick/dev/osgswig-read-only/src/python
linked by target "_osgViewer" in directory
/home/patrick/dev/osgswig-read-only/src/python
OSGDB_LIBRARY
linked by target "_osgDB" in directory
/home/patrick/dev/osgswig-read-only/src/python
linked by target "_osgFX" in directory
/home/patrick/dev/osgswig-read-only/src/python
OSGFX_LIBRARY
linked by target "_osgFX" in directory
/home/patrick/dev/osgswig-read-only/src/python
OSGGA_LIBRARY
linked by target "_osgGA" in directory
/home/patrick/dev/osgswig-read-only/src/python
linked by target "_osgManipulator" in directory
/home/patrick/dev/osgswig-read-only/src/python
linked by target "_osgSim" in directory
/home/patrick/dev/osgswig-read-only/src/python
linked by target "_osgText" in directory
/home/patrick/dev/osgswig-read-only/src/python
linked by target "_osgViewer" in directory
/home/patrick/dev/osgswig-read-only/src/python
OSGMANIPULATOR_LIBRARY
linked by target "_osgManipulator" in directory
/home/patrick/dev/osgswig-read-only/src/python
OSGSIM_LIBRARY
linked by target "_osgSim" in directory
/home/patrick/dev/osgswig-read-only/src/python
OSGTEXT_LIBRARY
linked by target "_osgText" in directory
/home/patrick/dev/osgswig-read-only/src/python
OSGUTIL_LIBRARY
linked by target "_osgFX" in directory
/home/patrick/dev/osgswig-read-only/src/python
linked by target "_osgManipulator" in directory
/home/patrick/dev/osgswig-read-only/src/python
linked by target "_osgSim" in directory
/home/patrick/dev/osgswig-read-only/src/python
linked by target "_osgUtil" in directory
/home/patrick/dev/osgswig-read-only/src/python
OSGVIEWER_LIBRARY
linked by target "_osgViewer" in directory
/home/patrick/dev/osgswig-read-only/src/python
OSG_INCLUDE_DIR
   used as include directory in directory /home/patrick/dev/osgswig-read-only
   used as include directory in directory 
/home/patrick/dev/osgswig-read-only/src
   used as include directory in directory
/home/patrick/dev/osgswig-read-only/src/python
OSG_LIBRARY
linked by target "_osg" in directory
/home/patrick/dev/osgswig-read-only/src/python
linked by target "_osgDB" in directory
/home/patrick/dev/osgswig-read-only/src/python
linked by target "_osgFX" in directory
/home/patrick/dev/osgswig-read-only/src/python
linked by target "_osgGA" in directory
/home/patrick/dev/osgswig-read-only/src/python
linked by target "_osgManipulator" in directory
/home/patrick/dev/osgswig-read-only/src/python
linked by target "_osgSim" in directory
/home/patrick/dev/osgswig-read-only/src/python
linked by target "_osgText" in directory
/home/patrick/dev/osgswig-read-only/src/python
linked by target "_osgUtil" in directory
/home/patrick/dev/osgswig-read-only/src/python
linked by target "_osgViewer" in directory
/home/patrick/dev/osgswig-read-only/src/python

-- Configuring incomplete, errors occurr

Re: [osg-users] cant move the scene

2008-11-14 Thread hemanth korrapati
Thank You. That worked.

On Fri, Nov 14, 2008 at 7:12 PM, Robert Osfield
<[EMAIL PROTECTED]> wrote:
> HI Henanth,
>
> You code is missing a return from your event handler method when the
> method type required a bool.  If you don't handle the event you should
> pass back false, in your case you aren't so the results are undefined
> and most likely are being interpreted as a true with will event
> handlers will detect later on an ignore the already "handled" event.
>
> Robert.
>
> On Fri, Nov 14, 2008 at 1:27 PM, hemanth korrapati
> <[EMAIL PROTECTED]> wrote:
>> hi,
>>
>> I am using an osg code which plots a few points in 3D space. This
>> works fine and I am able to move around the scene with the mouse. But
>> when I add the  line "viewer.addEventHandler(new
>> KeyboardEventHandler());" to the code and run it, I cant move the
>> scene/objects (generally we can move the scene by clicking and
>> dragging with the mouse)  . It just stays still even if I drag the
>> mouse around. I am pasting the code I am using, below:
>>
>> ---
>> #include
>> #include
>> #include
>> #include
>> #include"global.h"
>> #include"drawables.cpp"
>> #include"ransac.cpp"
>>
>>
>> using namespace std;
>>
>> class KeyboardEventHandler : public osgGA::GUIEventHandler
>> {
>> public:
>>virtual bool handle(const osgGA::GUIEventAdapter&
>> ea,osgGA::GUIActionAdapter&)
>>{
>>}
>> };
>>
>> osg::Camera* createHUD()
>> {
>>osg::Camera* camera = new osg::Camera;
>>
>>camera->setProjectionMatrix(osg::Matrix::ortho2D(0,2560,0,2048));
>>
>>camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
>>camera->setViewMatrix(osg::Matrix::identity());
>>
>>camera->setClearMask(GL_DEPTH_BUFFER_BIT);
>>
>>camera->setRenderOrder(osg::Camera::POST_RENDER);
>>
>>camera->setAllowEventFocus(false);
>>
>>
>>return camera;
>> }
>>
>>
>>
>> int main(int argc,char* argv[])
>> {
>>
>>osgViewer::Viewer viewer;
>>viewer.setCameraManipulator(new osgGA::TrackballManipulator);
>>viewer.addEventHandler(new osgViewer::StatsHandler);
>>viewer.addEventHandler(new KeyboardEventHandler());
>>   //this is the line giving problems
>>
>>osg::Group* root=new osg::Group();
>>osg::Geode* geode=new osg::Geode();
>>
>>ifstream infile("data1",ios::in);
>>vector points;
>>double temp1,temp2,temp3;
>>//for(int i=0;i<54;i++)
>>//infile >> temp1 >> temp2 >> temp3;
>>for(int i=0;i<180;i++)
>>{
>>if(infile >> temp1 >> temp2 >> temp3)
>>points.push_back(osg::Vec3(temp1,temp2,temp3));
>>
>>}
>>osg::Plane plane(osg::Vec3(0,0,1.83),points[90],points[45]);
>>for(int i=0;i<180;i++)
>>{
>>if(i==180)
>>//  cout <<
>> "==" <<
>> endl;
>>double dist=plane.distance(points[i]);
>>if(i<180)
>>
>> root->addChild(drawBox(points[i],0.2,osg::Vec4(1,1,1,1)));
>>//cout << dist<< endl;
>>}
>>
>>osg::Plane plane1(points[60],points[90],points[45]);
>>osg::Vec3 norm=plane1.getNormal();
>>norm.normalize();
>>osg::Vec3Array* vertices=new osg::Vec3Array();
>>vertices->push_back(osg::Vec3(100,-100,0)^norm);
>>vertices->push_back(osg::Vec3(100,100,0)^norm);
>>vertices->push_back(osg::Vec3(-100,100,0)^norm);
>>vertices->push_back(osg::Vec3(-100,-100,0)^norm);
>>
>>
>> //  geode->addDrawable(createPolygon(vertices));
>>root->addChild(geode);
>>
>>
>>
>>
>>
>>viewer.setSceneData(root);
>>viewer.run();
>>
>> }
>> ___
>> 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] osgswig binary release?

2008-11-14 Thread Gerwin de Haan
Luigi,

As far as the wrapping of osg::MixinVectors goes to support osg 2.6 and on
with osgswig, I did get a response from the swig maintainer William Fulton
on how to go about on this:

"... The easiest is probably to run SWIG -E on std_vector.i and copy paste
and change std to osg and vector to MixinVector. You'll see that there is a
lot of code developed for some of these target languages and you could
provide a much simpler cut down api, something similar to the Java approach,
see Lib/java/std_vector.i."

I'm not sure I find a timeslot to do this anytime soon.
Gerwin



On Fri, Nov 14, 2008 at 12:12 PM, Luigi Calori <[EMAIL PROTECTED]> wrote:

> Here
>
> http://virtualrome.googlecode.com/svn/trunk/py_code/py25_apps/PyPackages/osg.zip
>
> you can find an osgSwig (from some month ago, with some patches) I has been
> built with Visual Stusio 7.1 against OSG 2.5 (included with the zip)
> It has been tested with python 2.5 win32 binary, you can test by adding the
> folder where you extract the zip to the PYTHONPATH env variable
>
> I'm  trying to build osgSwig svn with OSG 2.6 (Viual Studio compiler)buth
> there is a still unsolved problem, reported in
> http://code.google.com/p/osgswig/issues/detail?id=12#c3
> due to substitution of std::vector with osg::MixinVectors   (this low level
> change prevents wrapper access to functions for building arrays)
> I also had to make some changes to build as reported in
> http://code.google.com/p/osgswig/issues/detail?id=13
>
> If interested, let me know
>
> Luigi
>
>
> Phan, Linh H ha scritto:
>
>> Hi,
>>I'm having a real hard time compiling osgswig (gotten from osgswig svn)
>> for OpenSceneGraph 2.3.4 on Windows using MinGW or cygwin.  The README said
>> that it has been tested with OpenSceneGraph 2.3.4.  Does anyone have a
>> pre-built Windows binary for osgswig that they can make available?  I would
>> really appreciate it.
>>  Thank you,
>>  Linh
>>   
>>
>> ___
>> 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] Stereo : Meaning of "field sequential", I-visor

2008-11-14 Thread David Spilling
Thanks for the help. That all worked, more or less out-of-the-box, using
QUAD_BUFFER. As suggested, we had to enable stereo in the OpenGL driver.

I was slightly misinformed about the actual hardware, what we are actually
using is this : http://www.vuzix.com/iwear/products_vr920.html, which also
uses a field sequential sort of stereo. LIke I said though, all works OK.

Out of curiosity, in a couple of our apps we set various features of the
views e.g. window sizes (via graphics context traits), projection matrix
resize policy and so on. For anaglyphic stereo mode, this was all fine, but
in quad buffer, we got lots of OpenGL warnings. Turning a big set of methods
off fixed them in the short term, but lost some functionality; in the long
term we'd like to fix this.Are there things that one shouldn't do in
quad_buffer that are OK in other stereo modes?

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


Re: [osg-users] cant move the scene

2008-11-14 Thread Robert Osfield
HI Henanth,

You code is missing a return from your event handler method when the
method type required a bool.  If you don't handle the event you should
pass back false, in your case you aren't so the results are undefined
and most likely are being interpreted as a true with will event
handlers will detect later on an ignore the already "handled" event.

Robert.

On Fri, Nov 14, 2008 at 1:27 PM, hemanth korrapati
<[EMAIL PROTECTED]> wrote:
> hi,
>
> I am using an osg code which plots a few points in 3D space. This
> works fine and I am able to move around the scene with the mouse. But
> when I add the  line "viewer.addEventHandler(new
> KeyboardEventHandler());" to the code and run it, I cant move the
> scene/objects (generally we can move the scene by clicking and
> dragging with the mouse)  . It just stays still even if I drag the
> mouse around. I am pasting the code I am using, below:
>
> ---
> #include
> #include
> #include
> #include
> #include"global.h"
> #include"drawables.cpp"
> #include"ransac.cpp"
>
>
> using namespace std;
>
> class KeyboardEventHandler : public osgGA::GUIEventHandler
> {
> public:
>virtual bool handle(const osgGA::GUIEventAdapter&
> ea,osgGA::GUIActionAdapter&)
>{
>}
> };
>
> osg::Camera* createHUD()
> {
>osg::Camera* camera = new osg::Camera;
>
>camera->setProjectionMatrix(osg::Matrix::ortho2D(0,2560,0,2048));
>
>camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
>camera->setViewMatrix(osg::Matrix::identity());
>
>camera->setClearMask(GL_DEPTH_BUFFER_BIT);
>
>camera->setRenderOrder(osg::Camera::POST_RENDER);
>
>camera->setAllowEventFocus(false);
>
>
>return camera;
> }
>
>
>
> int main(int argc,char* argv[])
> {
>
>osgViewer::Viewer viewer;
>viewer.setCameraManipulator(new osgGA::TrackballManipulator);
>viewer.addEventHandler(new osgViewer::StatsHandler);
>viewer.addEventHandler(new KeyboardEventHandler());
>   //this is the line giving problems
>
>osg::Group* root=new osg::Group();
>osg::Geode* geode=new osg::Geode();
>
>ifstream infile("data1",ios::in);
>vector points;
>double temp1,temp2,temp3;
>//for(int i=0;i<54;i++)
>//infile >> temp1 >> temp2 >> temp3;
>for(int i=0;i<180;i++)
>{
>if(infile >> temp1 >> temp2 >> temp3)
>points.push_back(osg::Vec3(temp1,temp2,temp3));
>
>}
>osg::Plane plane(osg::Vec3(0,0,1.83),points[90],points[45]);
>for(int i=0;i<180;i++)
>{
>if(i==180)
>//  cout <<
> "==" <<
> endl;
>double dist=plane.distance(points[i]);
>if(i<180)
>
> root->addChild(drawBox(points[i],0.2,osg::Vec4(1,1,1,1)));
>//cout << dist<< endl;
>}
>
>osg::Plane plane1(points[60],points[90],points[45]);
>osg::Vec3 norm=plane1.getNormal();
>norm.normalize();
>osg::Vec3Array* vertices=new osg::Vec3Array();
>vertices->push_back(osg::Vec3(100,-100,0)^norm);
>vertices->push_back(osg::Vec3(100,100,0)^norm);
>vertices->push_back(osg::Vec3(-100,100,0)^norm);
>vertices->push_back(osg::Vec3(-100,-100,0)^norm);
>
>
> //  geode->addDrawable(createPolygon(vertices));
>root->addChild(geode);
>
>
>
>
>
>viewer.setSceneData(root);
>viewer.run();
>
> }
> ___
> 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] Stereo : Meaning of "field sequential", I-visor

2008-11-14 Thread Jan Ciger
> Jan,
>
> Thanks for the very informative reply.

Welcome. 

>
>
> Unfortunately, what they do not tell you in their sales pitch is that you
>
> > need at least one of the high-end Quadros (about 800 USD+ investment for
> > the
> > cheapest one) to have this to work - the lower end stuff doesn't support
> > stereo ...
>
> We have it on a Quadro (Quadro FX 2500M); hence just running "quad_buffer"
> should work?

If that card supports stereo (can't find it on the web site), then yes. Don't 
forget to turn on the stereo support in the driver settings (in the nVidia 
control panel on Windows, in xorg.conf on Linux) first, though - otherwise you 
will get an OpenGL error when you try to use an unsupported feature.

Regards,

Jan


signature.asc
Description: This is a digitally signed message part.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Stereo : Meaning of "field sequential", I-visor

2008-11-14 Thread Pierre Bourdin (gmail)
Le vendredi 14 novembre 2008 à 13:20 +, David Spilling a écrit :

> Jan,
> 
> Thanks for the very informative reply.
> 
> 
> 
> Unfortunately, what they do not tell you in their sales pitch
> is that you
> need at least one of the high-end Quadros (about 800 USD+
> investment for the
> cheapest one) to have this to work - the lower end stuff
> doesn't support
> stereo ...
> 
> 
> We have it on a Quadro (Quadro FX 2500M); hence just running
> "quad_buffer" should work?
> 
> David
> 

Yes it's working out of shell with osgviewer,  setting it in stereo
mode:

OSG_STEREO=ON
OSG_STEREO_MODE=QUAD_BUFFER

You may also need to activate de quad buffer rendering of your quadro in
the advance settings (or stereo rendering may be, can't remember the
exact name...)

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


Pierre BOURDIN
I.M.E.R.I.R.
Av. Pascot BP 90443
66004 PERPIGNAN
tél: 04 68 56 80 18
fax: 04 68 55 03 86
email: [EMAIL PROTECTED]

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


[osg-users] cant move the scene

2008-11-14 Thread hemanth korrapati
hi,

I am using an osg code which plots a few points in 3D space. This
works fine and I am able to move around the scene with the mouse. But
when I add the  line "viewer.addEventHandler(new
KeyboardEventHandler());" to the code and run it, I cant move the
scene/objects (generally we can move the scene by clicking and
dragging with the mouse)  . It just stays still even if I drag the
mouse around. I am pasting the code I am using, below:

---
#include
#include
#include
#include
#include"global.h"
#include"drawables.cpp"
#include"ransac.cpp"


using namespace std;

class KeyboardEventHandler : public osgGA::GUIEventHandler
{
public:
virtual bool handle(const osgGA::GUIEventAdapter&
ea,osgGA::GUIActionAdapter&)
{
}
};

osg::Camera* createHUD()
{
osg::Camera* camera = new osg::Camera;

camera->setProjectionMatrix(osg::Matrix::ortho2D(0,2560,0,2048));

camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
camera->setViewMatrix(osg::Matrix::identity());

camera->setClearMask(GL_DEPTH_BUFFER_BIT);

camera->setRenderOrder(osg::Camera::POST_RENDER);

camera->setAllowEventFocus(false);


return camera;
}



int main(int argc,char* argv[])
{

osgViewer::Viewer viewer;
viewer.setCameraManipulator(new osgGA::TrackballManipulator);
viewer.addEventHandler(new osgViewer::StatsHandler);
viewer.addEventHandler(new KeyboardEventHandler());
   //this is the line giving problems

osg::Group* root=new osg::Group();
osg::Geode* geode=new osg::Geode();

ifstream infile("data1",ios::in);
vector points;
double temp1,temp2,temp3;
//for(int i=0;i<54;i++)
//infile >> temp1 >> temp2 >> temp3;
for(int i=0;i<180;i++)
{
if(infile >> temp1 >> temp2 >> temp3)
points.push_back(osg::Vec3(temp1,temp2,temp3));

}
osg::Plane plane(osg::Vec3(0,0,1.83),points[90],points[45]);
for(int i=0;i<180;i++)
{
if(i==180)
//  cout <<
"==" <<
endl;
double dist=plane.distance(points[i]);
if(i<180)

root->addChild(drawBox(points[i],0.2,osg::Vec4(1,1,1,1)));
//cout << dist<< endl;
}

osg::Plane plane1(points[60],points[90],points[45]);
osg::Vec3 norm=plane1.getNormal();
norm.normalize();
osg::Vec3Array* vertices=new osg::Vec3Array();
vertices->push_back(osg::Vec3(100,-100,0)^norm);
vertices->push_back(osg::Vec3(100,100,0)^norm);
vertices->push_back(osg::Vec3(-100,100,0)^norm);
vertices->push_back(osg::Vec3(-100,-100,0)^norm);


//  geode->addDrawable(createPolygon(vertices));
root->addChild(geode);





viewer.setSceneData(root);
viewer.run();

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


Re: [osg-users] Stereo : Meaning of "field sequential", I-visor

2008-11-14 Thread David Spilling
Jan,

Thanks for the very informative reply.


Unfortunately, what they do not tell you in their sales pitch is that you
> need at least one of the high-end Quadros (about 800 USD+ investment for
> the
> cheapest one) to have this to work - the lower end stuff doesn't support
> stereo ...


We have it on a Quadro (Quadro FX 2500M); hence just running "quad_buffer"
should work?

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


Re: [osg-users] Stereo : Meaning of "field sequential", I-visor

2008-11-14 Thread Jan Ciger
Hi David,

> Dear All,
>
> I'm a bit new to stereo modes (so take pity on me), but are any of the OSG
> supported stereo modes (QUAD_BUFFER, *_INTERLACE, *_SPLIT, *_EYE,
> ANAGLYPHIC) the same thing as "field sequential"? I guess I know that the
> interlace/split/anaglyphic ones are out, but I was not sure what
> quad_buffer actually supported...

Field-sequential stereo means that the frames are sent in a time-multiplexed 
manner - i.e. first left image, then right image, then left image, then right 
image, etc.

This is typically used with shutter glasses, with an extra wire to synchronize 
them. OSG supports this mode using the QUAD_BUFFER mode. However, to have this 
work you need a graphic card and driver that support it - that is typically 
something from the nVidia Quadro range or ATI FireGL. 

The consumer hardware (GeForce, Radeon) has it disabled and typically lack the 
extra mini DIN synchronization connector (three pin, round connector, similar 
to the old PS/2 mouse connector). 

nVidia has something called "consumer stereo" driver for GeForce that will 
generate frame-sequential stereo imagery by intercepting the DirectX/OpenGL 
pipeline, moving the camera and rendering each frame twice for you, however I 
cannot recommend it. It is incredibly difficult to get to work (the Windows-
only drivers work only with specific versions of ForceWare in Windows, usually 
very old ones that do not support current hardware), it is unstable and you 
have little control over the stereo settings. Also, it doesn't actually give 
you QUAD_BUFFER support, so you need to render normally and pray that the 
driver does its magic and you get a somewhat correct stereo output.

>
> Has anybody tried to get these things (
> http://www.personaldisplay.com/content/fmds/fmd_sub02_01.asp, and related
> models) working with OSG?
>

That should be pretty easy to get working with a Quadro, set to synchronize 
via the DDC pin on the VGA connector. Set OSG to QUAD_BUFFER mode and off you 
go. Unfortunately, what they do not tell you in their sales pitch is that you 
need at least one of the high-end Quadros (about 800 USD+ investment for the 
cheapest one) to have this to work - the lower end stuff doesn't support 
stereo ...

The FX605 seems to be a better option - it takes two VGA inputs where you feed 
both images in parallel (HORIZONTAL_SPLIT or VERTICAL_SPLIT OSG mode). That 
you can feed with any graphic card with two VGA outputs, even an old GeForce 
will do. This way of feeding the HMD is common on the higher-end hardware as 
well, in case you would like to upgrade later.

Regards,

Jan




signature.asc
Description: This is a digitally signed message part.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] geotiff images for use with VPB

2008-11-14 Thread christophe loustaunau
Hi Juan,


I don't know if I can georeference the png images, converting them to
> geotiff, using gdal_translate?
>
Yes you can.


> If so, how can I do that? what parameters do I need to pass to
> gdal_translate?
>
>

Take a look here : http://www.gdal.org/gdal_translate.html
All the parameters are explain.

See also this page :
http://www.openscenegraph.org/projects/VirtualPlanetBuilder/wiki/ExampleClusterJPD
Where you can see how to georeference the Blue Marble Next Generation data,
it's a good example, and it's really the same thing of what you wan't to do.


Regards.

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


[osg-users] unsigned int missing in osg::Uniform?

2008-11-14 Thread Ferdi Smit
It appears that support for a single unsigned int uniform is missing. In 
include 
/osg 
/Uniform 
 
there is support for:


UNSIGNED_INT_VEC2 = GL_UNSIGNED_INT_VEC2_EXT,
UNSIGNED_INT_VEC3 = GL_UNSIGNED_INT_VEC3_EXT,
UNSIGNED_INT_VEC4 = GL_UNSIGNED_INT_VEC4_EXT,

but GL_UNSIGNED_INT is not there, if I am correct. Is there any reason 
for this, or is it by accident?


--
Regards,

Ferdi Smit
Email: [EMAIL PROTECTED]
Room: C0.07  Phone: 4229
INS3 Visualization and 3D Interfaces
CWI Amsterdam, The Netherlands

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


[osg-users] Re: FBO FrameBufferObject and stencil support

2008-11-14 Thread Himar Carmona
Hi,

   using trunk version works fine. I suspect my graphics card doesn't
support "unpacked" depth and stencil buffers (NVIDIA Geforce 8600 GT).

   Only one comment about its implementation inside OSG:

 In RenderStage.runCameraSetup when the fbo is being initialized, if the
camera has two attachment (in my example they are COLOR_BUFFER and
PACKED_DEPTH_STENCIL_BUFFER), the second one isn't detected as DEPTH_BUFFER,
and the flag depthattached remains with 0. After that OSG initializes
another rendebuffer for depth_buffer and attaches it. So, there are three
attachments, COLOR_BUFFER, PACKED_DEPTH_STENCIL_BUFFER and DEPTH_BUFFER
(automatically done by runCameraSetup). I think this works because the last
attached is PACKED_DEPTH_STENCIL_BUFFER and overrides the DEPTH_BUFFER one.

Perhaps these details could be helpful for someone having problems or
debugging OSG fbo support.

Thanks for the quick responses!!!
Himar.



2008/11/12 Robert Osfield <[EMAIL PROTECTED]>

> Hi Himar,
>
> On Wed, Nov 12, 2008 at 10:56 AM, Himar Carmona <[EMAIL PROTECTED]>
> wrote:
> >1) Does OSG 2.6.1 supports FBO with stencil buffer attachment?
>
> It should do.  I haven't personally tested it, but the code paths are all
> there.
>
> >2) Does it supports EXT_PACKED_DEPTH_STENCIL?
>
> 2.6.1 doesn't support this extension, but I merged a submission for
> this last week so it's in 2.7.5 and svn/trunk.
>
> Robert.
> ___
> 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] geotiff images for use with VPB

2008-11-14 Thread J.P. Delport

Hi,

see the following page where I did something similar for the Blue Marble 
NG tiff files.


http://www.openscenegraph.org/projects/VirtualPlanetBuilder/wiki/ExampleClusterJPD

You can use gdal_translate.

e.g.

gdal_translate -of GTiff -a_srs "+proj=latlong +datum=WGS84" -a_ullr 
-180 90 -90   0 world.topo.bathy.200407.3x21600x21600.A1.jpg A1.tif



jp

Juan Sebastian Casanueva wrote:

Hi,
I am using VPB to generate a terrain. I use DTED for elevation and I now 
want to put textures to the terrain.
I have textures in png format, and I want to generate geotiff files from 
them so that I can use them with VPB.
All the png images are 1 degree x 1 degree in latitude/longitude, so I 
know the coordinates of the corners. I don't know if I can georeference 
the png images, converting them to geotiff, using gdal_translate?
If so, how can I do that? what parameters do I need to pass to 
gdal_translate?
 
I realize that this mailing list might not be the place to ask this 
question, but maybe someone here can help me:)
 
thanks a lot

Juan




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


--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.


This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.


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


Re: [osg-users] build osgdem on osx

2008-11-14 Thread Massimo Di Stefano

Hi,

yes my fault, i'm tring osgGIS (not osgdem)

looking at my framework installation i can see that it is an old  
version :-/


now i'm tring to build osg from source ...


i'm using xcode 3.1
 i setted it to :

General:
Project Format : Xcode 3.0-compatible
Base SDK for All Configuration :  Mac OS X 10.5

Build :
Base SDK : Mac OS X 10.5

i tried using both :
Build Active Architecture Only "checcked"
and uncecched

but xcode give me the follow 2 erros :

Building target “osgdb_ive” of project “OpenSceneGraph” with  
configuration “Development” — (2 errors)

cd /GIS/DEP/OpenSceneGraph/Xcode/OpenSceneGraph
/Developer/usr/bin/g++-4.0 -arch i386 -bundle -isysroot / 
Developer/SDKs/MacOSX10.5.sdk -L/GIS/DEP/OpenSceneGraph/Xcode/ 
OpenSceneGraph/build/Development -F/GIS/DEP/OpenSceneGraph/Xcode/ 
OpenSceneGraph/build/Development -F/Users/sasha/Library/Frameworks -F/ 
Developer/SDKs/MacOSX10.5.sdk/Library/Frameworks -filelist /GIS/DEP/ 
OpenSceneGraph/Xcode/OpenSceneGraph/build/OpenSceneGraph.build/ 
Development/osgdb_ive.build/Objects-normal/i386/osgdb_ive.LinkFileList  
-mmacosx-version-min=10.5 -framework OpenThreads -framework osgTerrain  
-framework osg -framework osgDB -framework osgSim -framework osgText - 
framework osgUtil -framework osgFX -o /GIS/DEP/OpenSceneGraph/Xcode/ 
OpenSceneGraph/build/Development/osgdb_ive.so

Undefined symbols:
  "ive::BlendEquation::read(ive::DataInputStream*)", referenced from:
  ive::DataInputStream::readStateAttribute()  in osgdb_ive.so- 
i386-master.o

  "ive::BlendEquation::write(ive::DataOutputStream*)", referenced from:
  ive::DataOutputStream::writeStateAttribute(osg::StateAttribute  
const*)   in osgdb_ive.so-i386-master.o

ld: symbol(s) not found
collect2: ld returned 1 exit status
  "ive::BlendEquation::read(ive::DataInputStream*)", referenced 
from:
		  ive::DataInputStream::readStateAttribute()  in  
osgdb_ive.so-i386-master.o
		  "ive::BlendEquation::write(ive::DataOutputStream*)", referenced  
from:
		  ive::DataOutputStream::writeStateAttribute(osg::StateAttribute  
const*)   in osgdb_ive.so-i386-master.o

ld: symbol(s) not found
collect2: ld returned 1 exit status



any help is most appreciated,
thanks to All!

reagards,
Massimo.


f

On Nov 14, 2008, at 4:48 AM, Glenn Waldron wrote:


Massimo,
It looks like you are trying to compile osgGIS (not osgdem, which is  
part of a different package called VirtualPlanetBuilder). The  
warnings indicate that you have an old version and need to upgrade  
to the latest SVN head. -gw


Glenn Waldron : Pelican Mapping : http://pelicanmapping.com :  
+1.703.652.4791



On Thu, Nov 13, 2008 at 7:45 PM, Massimo Di Stefano <[EMAIL PROTECTED] 
> wrote:

Hi,

i'm tring to install osgdem on osx 10.5
but after alot of worning message :-/
it fails to build with these error :

[ 78%] Building CXX object src/osgGIS/CMakeFiles/osgGIS.dir/Utils.o
In file included from /GIS/DEP/osgis/src/osgGIS/Common:26,
from /GIS/DEP/osgis/src/osgGIS/Utils:4,
from /GIS/DEP/osgis/src/osgGIS/Utils.cpp:1:
/GIS/DEP/osgis/src/osgGIS/Export:44:1: warning: "OSGGIS_EXPORT"  
redefined
/GIS/DEP/osgis/src/osgGIS/Export:30:1: warning: this is the location  
of the previous definition

In file included from /GIS/DEP/osgis/src/osgGIS/Common:26,
from /GIS/DEP/osgis/src/osgGIS/Utils:4,
from /GIS/DEP/osgis/src/osgGIS/Utils.cpp:1:
/GIS/DEP/osgis/src/osgGIS/Export:44:1: warning: "OSGGIS_EXPORT"  
redefined
/GIS/DEP/osgis/src/osgGIS/Export:30:1: warning: this is the location  
of the previous definition
/GIS/DEP/osgis/src/osgGIS/Utils.cpp: In function 'int  
save_image_as_DDS(const char*, int, int, int, const unsigned char*)':
/GIS/DEP/osgis/src/osgGIS/Utils.cpp:398: error: 'int  
save_image_as_DDS(const char*, int, int, int, const unsigned char*)'  
was declared 'extern' and later 'static'
/GIS/DEP/osgis/src/osgGIS/Utils.cpp:248: error: previous declaration  
of 'int save_image_as_DDS(const char*, int, int, int, const unsigned  
char*)'
/GIS/DEP/osgis/src/osgGIS/Utils.cpp: In function 'unsigned char*  
convert_image_to_DXT1(const unsigned char*, int, int, int, int*)':
/GIS/DEP/osgis/src/osgGIS/Utils.cpp:456: error: 'unsigned char*  
convert_image_to_DXT1(const unsigned char*, int, int, int, int*)'  
was declared 'extern' and later 'static'
/GIS/DEP/osgis/src/osgGIS/Utils.cpp:259: error: previous declaration  
of 'unsigned char* convert_image_to_DXT1(const unsigned char*, int,  
int, int, int*)'
/GIS/DEP/osgis/src/osgGIS/Utils.cpp: In function 'unsigned char*  
convert_image_to_DXT5(const unsigned char*, int, int, int, int*)':
/GIS/DEP/osgis/src/osgGIS/Utils.cpp:539: error: 'unsigned char*  
convert_image_to_DXT5(const unsigned char*, int, int, int, int*)'  
was declared 'extern' and later 'static'
/GIS/DEP/osgis/src/osgGIS/Utils.cpp:270: error: previous declaration  
of 'unsigned char* convert_image_to_DXT5(c

[osg-users] Stereo : Meaning of "field sequential", I-visor

2008-11-14 Thread David Spilling
Dear All,

I'm a bit new to stereo modes (so take pity on me), but are any of the OSG
supported stereo modes (QUAD_BUFFER, *_INTERLACE, *_SPLIT, *_EYE,
ANAGLYPHIC) the same thing as "field sequential"? I guess I know that the
interlace/split/anaglyphic ones are out, but I was not sure what quad_buffer
actually supported...

Has anybody tried to get these things (
http://www.personaldisplay.com/content/fmds/fmd_sub02_01.asp, and related
models) working with OSG?

Thanks in advance,

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


Re: [osg-users] osgswig binary release?

2008-11-14 Thread Luigi Calori

Here
http://virtualrome.googlecode.com/svn/trunk/py_code/py25_apps/PyPackages/osg.zip

you can find an osgSwig (from some month ago, with some patches) I has 
been built with Visual Stusio 7.1 against OSG 2.5 (included with the zip)
It has been tested with python 2.5 win32 binary, you can test by adding 
the folder where you extract the zip to the PYTHONPATH env variable


I'm  trying to build osgSwig svn with OSG 2.6 (Viual Studio 
compiler)buth there is a still unsolved problem, reported in

http://code.google.com/p/osgswig/issues/detail?id=12#c3
due to substitution of std::vector with osg::MixinVectors   (this low 
level change prevents wrapper access to functions for building arrays)

I also had to make some changes to build as reported in
http://code.google.com/p/osgswig/issues/detail?id=13

If interested, let me know

Luigi


Phan, Linh H ha scritto:

Hi,
 
  I'm having a real hard time compiling osgswig (gotten from osgswig 
svn) for OpenSceneGraph 2.3.4 on Windows using MinGW or cygwin.  The 
README said that it has been tested with OpenSceneGraph 2.3.4.  Does 
anyone have a pre-built Windows binary for osgswig that they can make 
available?  I would really appreciate it.
 
Thank you,
 
Linh
 
 



___
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] Compile error - ConvertUTF on osgDB in Cygwin

2008-11-14 Thread Alberto Luaces
El Viernes 14 Noviembre 2008ES 04:29:48 Brian Keener escribió:
> Just updated from SVN and tried to compile in Cygwin for a periodic
> compile test and received the following errors.  I cleaned out the
> build directory and reconfigured and still got the same error.
>
> Am I missing some library or ???

Hi Brian,

A patch sent this week is pending on the submissions queue to be applied. See 
the osg-submissions list if you want to have OSG compiling now:

http://www.mail-archive.com/[EMAIL PROTECTED]/msg02349.html

Regards,

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


[osg-users] geotiff images for use with VPB

2008-11-14 Thread Juan Sebastian Casanueva
Hi,
I am using VPB to generate a terrain. I use DTED for elevation and I now want 
to put textures to the terrain.
I have textures in png format, and I want to generate geotiff files from them 
so that I can use them with VPB. 
All the png images are 1 degree x 1 degree in latitude/longitude, so I know the 
coordinates of the corners. I don't know if I can georeference the png images, 
converting them to geotiff, using gdal_translate? 
If so, how can I do that? what parameters do I need to pass to gdal_translate? 
 
I realize that this mailing list might not be the place to ask this question, 
but maybe someone here can help me:) 
 
thanks a lot
Juan
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] RenderBuffer Use case scenario

2008-11-14 Thread Robert Osfield
Hi RJ,

You need to go read the OpenGL specs on FBO, this will be the best
explanation of the role of renderbuffers.

Robert.

On Fri, Nov 14, 2008 at 9:48 AM, Rahul Jain <[EMAIL PROTECTED]> wrote:
> Hi Robert,
> I know that it is part of the FBO. What i am asking is the application
> cases in which this can be used ? For example we can use FBO + Texture
> for  reflectoins, environment mapping etc. But for RenderBuffer i am not
> able to think these application areas.
> cheers
> RJ
>
> Robert Osfield wrote:
>> Hi RJ,
>>
>> The RenderBuffer is just a component of a FrameBufferObject, and yes
>> it is supported by the OSG.  And FBO's are used for off screen
>> rendering and render to texture effects.
>>
>> Robert.
>>
>> On Fri, Nov 14, 2008 at 8:01 AM, Rahul Jain <[EMAIL PROTECTED]> wrote:
>>
>>> Hi All,
>>> What are the different scenarios in which OpenGL RenderBuffer can be
>>> used ? Do we use them in OSG ?
>>> Regards
>>> RJ
>>> ___
>>> 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
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] cannot get floating-point multisampled FBOs

2008-11-14 Thread Robert Osfield
Hi Marco,

On Fri, Nov 14, 2008 at 9:41 AM, Marco Jez <[EMAIL PROTECTED]> wrote:
> Sure, I'll send you the files later in the evening.
> BTW, is there any problem with the mailing list? I didn't get my own message
> back.

This is more likely to be just the gmail client not listing threads
you've started till others post to it.

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


Re: [osg-users] Teaching an intro to graphics course

2008-11-14 Thread Simon Hammett
I'll have a look this weekend. ty.

2008/11/14 Wang Rui <[EMAIL PROTECTED]>:
> Hi Simon,
>
> As Alberto Luaces said, there is an external library for OSG to support
> various polygon technologies, osgModeling
> (http://code.google.com/p/osgmodeling/) is completely new work and not
> familiar to others. But there have been already Bezier, NURBS, extrusions,
> revolutions (constructed by a profile rotated specified angles) and lofts
> (constructed by lofting a series of curves that define the cross section on
> a specified path) functions, also the boolean operation based on BSP tree of
> geometries.
>
> A future version will conclude the subdivision function (Loop and Sqrt3, and
> easy to add more) and a new NormalVisitor with 6 methods to calculate the
> weights and generate normals. It will be released in 1-2 weeks but you could
> check out the SVN version now.
>
> Hope it will help if you have a similar plan. The project is LGPL and you
> may use it freely, although tons of bugs in it at present. :)
>
> Wang Rui
>

-- 
The truth is out there. Usually in header files.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] RenderBuffer Use case scenario

2008-11-14 Thread Rahul Jain
Hi Robert,
I know that it is part of the FBO. What i am asking is the application
cases in which this can be used ? For example we can use FBO + Texture
for  reflectoins, environment mapping etc. But for RenderBuffer i am not
able to think these application areas.
cheers
RJ

Robert Osfield wrote:
> Hi RJ,
>
> The RenderBuffer is just a component of a FrameBufferObject, and yes
> it is supported by the OSG.  And FBO's are used for off screen
> rendering and render to texture effects.
>
> Robert.
>
> On Fri, Nov 14, 2008 at 8:01 AM, Rahul Jain <[EMAIL PROTECTED]> wrote:
>   
>> Hi All,
>> What are the different scenarios in which OpenGL RenderBuffer can be
>> used ? Do we use them in OSG ?
>> Regards
>> RJ
>> ___
>> 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] cannot get floating-point multisampled FBOs

2008-11-14 Thread Marco Jez

Hi Robert,


[...], or perhaps if it's 0 then
RenderStage.cpp code to look for an alternative as a fallback - first
it could check for a texture, then finally drop back to RGBA.


Yes, that's basically what my fix does.


Send me the changed file and I can pontificate on this.  Could you
also modify one of the render to texture examples to illustrate this
problem - as then I'll be able to test and confirm a fix.


Sure, I'll send you the files later in the evening.
BTW, is there any problem with the mailing list? I didn't get my own message 
back.


Marco


No virus found in this outgoing message.
Checked by AVG - http://www.avg.com
Version: 8.0.175 / Virus Database: 270.9.3/1786 - Release Date: 13/11/2008 18.01
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] RenderBuffer Use case scenario

2008-11-14 Thread Robert Osfield
Hi RJ,

The RenderBuffer is just a component of a FrameBufferObject, and yes
it is supported by the OSG.  And FBO's are used for off screen
rendering and render to texture effects.

Robert.

On Fri, Nov 14, 2008 at 8:01 AM, Rahul Jain <[EMAIL PROTECTED]> wrote:
> Hi All,
> What are the different scenarios in which OpenGL RenderBuffer can be
> used ? Do we use them in OSG ?
> Regards
> RJ
> ___
> 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] Compile error - ConvertUTF on osgDB in Cygwin

2008-11-14 Thread Robert Osfield
Hi Brian,

I believe this is fix in osg-submssions that awaits me review.  I'll
be doing a submission purge later today so will pick it up then, but
in the meantime just go check the osg-submissions archives for the
last week for the fix.

Robert.

On Fri, Nov 14, 2008 at 3:29 AM, Brian Keener
<[EMAIL PROTECTED]> wrote:
> Just updated from SVN and tried to compile in Cygwin for a periodic
> compile test and received the following errors.  I cleaned out the
> build directory and reconfigured and still got the same error.
>
> Am I missing some library or ???
>
> Thanks
>
> bk
>
> Linking CXX shared library ../../bin/cygosg-2.7.6.dll
> Creating library file: ../../lib/libosg.dll.a
> [ 14%] Built target osg
> Scanning dependencies of target osgDB
> [ 14%] Building CXX object src/osgDB/CMakeFiles/osgDB.dir/Archive.o
> [ 14%] Building CXX object
> src/osgDB/CMakeFiles/osgDB.dir/AuthenticationMap.o
> [ 14%] Building CXX object src/osgDB/CMakeFiles/osgDB.dir/ConvertUTF.o
> In file included from
> /usr/src/OpenSceneGraph/src/osgDB/ConvertUTF.cpp:14:
> /usr/src/OpenSceneGraph/include/osgDB/ConvertUTF:27: error: expected
> constructor
> , destructor, or type conversion before "convertUTF8toUTF16"
> /usr/src/OpenSceneGraph/include/osgDB/ConvertUTF:27: error: expected
> `,' or `;'
> before "convertUTF8toUTF16"
> /usr/src/OpenSceneGraph/include/osgDB/ConvertUTF:29: error: expected
> unqualified
> -id before '&' token
> /usr/src/OpenSceneGraph/include/osgDB/ConvertUTF:29: error: expected
> `,' or `...
> ' before '&' token
> /usr/src/OpenSceneGraph/include/osgDB/ConvertUTF:29: error: ISO C++
> forbids decl
> aration of `parameter' with no type
> /usr/src/OpenSceneGraph/include/osgDB/ConvertUTF: In function
> `std::string osgDB
> ::convertUTF16toUTF8(int)':
> /usr/src/OpenSceneGraph/include/osgDB/ConvertUTF:29: error: `s'
> undeclared (firs
> t use this function)
> /usr/src/OpenSceneGraph/include/osgDB/ConvertUTF:29: error: (Each
> undeclared ide
> ntifier is reported only once for each function it appears in.)
> /usr/src/OpenSceneGraph/include/osgDB/ConvertUTF: At global scope:
> /usr/src/OpenSceneGraph/include/osgDB/ConvertUTF:32: error: expected
> init-declar
> ator before "convertUTF8toUTF16"
> /usr/src/OpenSceneGraph/include/osgDB/ConvertUTF:32: error: expected
> `,' or `;'
> before "convertUTF8toUTF16"
> /usr/src/OpenSceneGraph/include/osgDB/ConvertUTF:33: error: expected
> init-declar
> ator before "convertUTF8toUTF16"
> /usr/src/OpenSceneGraph/include/osgDB/ConvertUTF:33: error: expected
> `,' or `;'
> before "convertUTF8toUTF16"
> /usr/src/OpenSceneGraph/src/osgDB/ConvertUTF.cpp:57: error: expected
> constructor
> , destructor, or type conversion before "convertUTF8toUTF16"
> /usr/src/OpenSceneGraph/src/osgDB/ConvertUTF.cpp:57: error: expected
> `,' or `;'
> before "convertUTF8toUTF16"
> make[2]: *** [src/osgDB/CMakeFiles/osgDB.dir/ConvertUTF.o] Error 1
> make[1]: *** [src/osgDB/CMakeFiles/osgDB.dir/all] Error 2
> make: *** [all] Error 2
>
> [EMAIL PROTECTED] /usr/develop/obj/osg
> $
>
>
>
>
> ___
> 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] cannot get floating-point multisampled FBOs

2008-11-14 Thread Robert Osfield
HI Marco,

I have tried combining multi-sampling and float point FBOs so haven't
come across this bug before.  I do wonder if the _internalFormat
itself could be automatically set, or perhaps if it's 0 then
RenderStage.cpp code to look for an alternative as a fallback - first
it could check for a texture, then finally drop back to RGBA.

Send me the changed file and I can pontificate on this.  Could you
also modify one of the render to texture examples to illustrate this
problem - as then I'll be able to test and confirm a fix.

Cheers,
Robet.

On Thu, Nov 13, 2008 at 10:55 PM, Marco Jez <[EMAIL PROTECTED]> wrote:
> I'm trying to add multisampling capabilities to my floating-point FBOs, but
> I've found what I think is a bug in osgUtil/RenderStage.cpp. Basically, when
> I specify a number of samples greater than 0, I actually get a
> non-floating-point framebuffer.
> See line 380 in RenderStage.cpp:
>
> GLenum internalFormat = attachment._internalFormat;
>
> if the attachment is actually a RTT target rather than a rendertarget, the
> internalFormat field will always be zero. This will make RenderStage pick
> the default value which is GL_RGBA, thus ignoring the target texture's
> internal format (GL_RGBA16F_ARB in my application). Replacing the above code
> with the following, fixes the problem for me:
>
> GLenum internalFormat;
> if (attachment._texture.valid())
>   internalFormat = attachment._texture->getInternalFormat();
> else
>   internalFormat = attachment._internalFormat;
>
> Now, I'm pretty new to all this multisampling stuff, and I'm not sure
> whether this fix is reliable and/or correct, so I'm not filing a submission
> for now. Robert, I can send the modified file if you think it's appropriate.
>
> Cheers,
> Marco
>
> ___
> 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] RenderBuffer Use case scenario

2008-11-14 Thread Rahul Jain
Hi All,
What are the different scenarios in which OpenGL RenderBuffer can be
used ? Do we use them in OSG ?
Regards
RJ
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org