[osg-users] osgvolume 2D image stack

2009-09-15 Thread Johannes van Jaarsveld
Hi,

I've been trying out the example application osgvolume. If I envoke the 
application via the following command

./osgvolume --images image1.jpg image2.jpg [up to including] image64.jpg 
--num-components 0 --r_maxTextureSize 512 --zMultiplier 1.0 -o volume.osg

I get the following command line response from the application:

Max texture size=2048
desiredPixelFormat = GL_RGB
Error: could not find file:

I have tried a wild card approach to specify the 2D image stack like in:

./osgvolume --images *.jpg --num-components 0 --r_maxTextureSize 512 
--zMultiplier 1.0 -o volume.osg

That does not work either. I assume that jpg or tiff files may be used to 
specify the 2D image stack.

Any hints would be appreciated.

Best Regards,
Johannes van Jaarsveld

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





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


Re: [osg-users] [osgPlugins] Error when loading DirectX .x files

2009-09-15 Thread Ulrich Hertlein

Hi Judy,

On 11/09/09 4:28 PM, Judy Hartley wrote:

As I said, this error happens no matter which of the many .x files I use.  It's 
not
just a warning because it does not draw the object or objects.  It also happens 
no
matter how many materials are listed.  If there are 10 materials listed in the 
.x file,
the message would say:

DirectX Loader: Error reading material list; 10 instead of 0

I thought it might mean the list should not be zero based, but changing the 
numbers to
start at 1 rather than 0 doesn't help.  The message still says:

DirectX Loader: Error reading material list; 1 instead of 0

I'm attaching one of the .x files that I've tried. I had to change the 
extension to
.txt in order to attach it here.


I had a look at the file you attached.  The file contains references to global materials 
that are referenced like '{ material-name }'.


The parser however expects materials to be without the curly braces around them (meaning 
if you remove the braces around the material name it works.)


The support for global materials was added later and I don't know which is the proper 
format.  Unfortunately the parser is not very flexible and AFAICS is not easily modified 
to handle this.


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


Re: [osg-users] osgvolume 2D image stack

2009-09-15 Thread Robert Osfield
Hi Johannes,

osgvolume suggesting that it can't find file but not specifying the filename
so perhaps it's a blank filename for some reason.  Try upping the verbosity
of the information logging via:

export OSG_NOTIFY_LEVEL=INFO

And then run the app, this should output more information about where it's
looking for what files, this might give us more of clue what is going amiss.

Robert.

On Tue, Sep 15, 2009 at 8:36 AM, Johannes van Jaarsveld 
jvjaarsv...@csir.co.za wrote:

 Hi,

 I've been trying out the example application osgvolume. If I envoke the
 application via the following command

 ./osgvolume --images image1.jpg image2.jpg [up to including] image64.jpg
 --num-components 0 --r_maxTextureSize 512 --zMultiplier 1.0 -o volume.osg

 I get the following command line response from the application:

 Max texture size=2048
 desiredPixelFormat = GL_RGB
 Error: could not find file:

 I have tried a wild card approach to specify the 2D image stack like in:

 ./osgvolume --images *.jpg --num-components 0 --r_maxTextureSize 512
 --zMultiplier 1.0 -o volume.osg

 That does not work either. I assume that jpg or tiff files may be used to
 specify the 2D image stack.

 Any hints would be appreciated.

 Best Regards,
 Johannes van Jaarsveld

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





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

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


Re: [osg-users] OSG viewer blocks Qt window

2009-09-15 Thread Maxim Gammer
QThread ?

2009/9/15 Philip Lowman phi...@yhbt.com

 Can you post a small example of the problem?  I've been using Qt with OSG
 for about a month now and haven't run into anything like this.

 Have you considered using something like a QTimer to send your keep-alive
 messages instead?


 On Mon, Sep 14, 2009 at 9:40 AM, Zoe Catz small_dra...@gmx.net wrote:

 Hi,

 I've written a Qt application. It's used to configure some settings which
 should be considered it my visualisation later on. In addition, this window
 update handles sending keep-alive messages via UDP in the background.

 The visualisation itselft should be rendered in an own window by OSG. The
 problem is, as soon as I add the osg window the qt window incl. the UDP
 packages are not updated/sent anymore.

 So my question is, how can I force both (qt and osg) windows to update?

 Thank you in advance!

 Cheers,
 grisu

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





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




 --
 Philip Lowman

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




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


Re: [osg-users] FBO OpenGL Error with new nVidia Driver

2009-09-15 Thread Sebastien Nerig
Hi Robert

Well, if I have asked something to this forum, this is because I have already 
investigated and I have found no solutions by myself.
I just wanted to know if someone else has accountered this problem and if a 
solution has been found - I think a forum is for sharing problems and solutions 
- but if I am the only one to have this opengl memory overflow problem, so I 
must be the only one to use nvidia card and pre rendering pass with osg :|.

By the way, the application is very simple because it is the osgPrerender 
example, and, as I said, the opengl memory overflow happens when a pre 
rendering pass is done into a fbo.
I have a pretty good nvidia graphic card with the last driver (190.38, august 
2009). I cannot try other hardware and if a solution is to downgrade drivers, I 
won't do that...

Well, if one day I find a solution I will share

Sebastien

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





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


Re: [osg-users] FBO OpenGL Error with new nVidia Driver

2009-09-15 Thread J.P. Delport

Hi,

Sebastien Nerig wrote:

Hi Robert

Well, if I have asked something to this forum, this is because I have
already investigated and I have found no solutions by myself. I just
wanted to know if someone else has accountered this problem and if a
solution has been found - I think a forum is for sharing problems and
solutions - but if I am the only one to have this opengl memory
overflow problem, so I must be the only one to use nvidia card and
pre rendering pass with osg :|.


No, I'm quite sure you are not.

We have a variety of NVidia cards (from laptops with 6 Series to newer 
GTX280s) with a variety of drivers (179 - 185) and OSG versions (2.8 to 
newest dev), and are using pre-render a lot for image processing. We are 
not getting any errors.


Explain a bit more of what you have tried. OSG version? OS? Does 
osgprerender by itself give errors? What are you doing in your shaders? 
Sizes of images? Render target formats? How much memory on the card?




By the way, the application is very simple because it is the
osgPrerender example, and, as I said, the opengl memory overflow
happens when a pre rendering pass is done into a fbo. I have a pretty
good nvidia graphic card with the last driver (190.38, august 2009).
I cannot try other hardware and if a solution is to downgrade
drivers, I won't do that...


If you can post the app, or a downscaled version that still shows the 
error, I can test it here and report back.


jp



Well, if one day I find a solution I will share

Sebastien

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






___ 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] FBO OpenGL Error with new nVidia Driver

2009-09-15 Thread Kim Bale
Hi Sebastian,

I've got this bloody error a number of times with a 8800 GTS 512, and
every time it's been because I've upgraded my drivers. I'm not sure
whether this is due to driver corruption or a bug in the drivers. But
I think your best is to try some of the previous driver sets, (I'm
pretty sure I had FBO issues with 185.85 but haven't tried any later
ones) and see if the problem goes away, as it certainly did in my
case.

I'm pretty certain it has nothing to do with the OSG as FBO support is
well established in the OSG and my programs worked fine before
changing drivers.

Kim.





2009/9/15 J.P. Delport jpdelp...@csir.co.za:
 Hi,

 Sebastien Nerig wrote:

 Hi Robert

 Well, if I have asked something to this forum, this is because I have
 already investigated and I have found no solutions by myself. I just
 wanted to know if someone else has accountered this problem and if a
 solution has been found - I think a forum is for sharing problems and
 solutions - but if I am the only one to have this opengl memory
 overflow problem, so I must be the only one to use nvidia card and
 pre rendering pass with osg :|.

 No, I'm quite sure you are not.

 We have a variety of NVidia cards (from laptops with 6 Series to newer
 GTX280s) with a variety of drivers (179 - 185) and OSG versions (2.8 to
 newest dev), and are using pre-render a lot for image processing. We are not
 getting any errors.

 Explain a bit more of what you have tried. OSG version? OS? Does
 osgprerender by itself give errors? What are you doing in your shaders?
 Sizes of images? Render target formats? How much memory on the card?


 By the way, the application is very simple because it is the
 osgPrerender example, and, as I said, the opengl memory overflow
 happens when a pre rendering pass is done into a fbo. I have a pretty
 good nvidia graphic card with the last driver (190.38, august 2009).
 I cannot try other hardware and if a solution is to downgrade
 drivers, I won't do that...

 If you can post the app, or a downscaled version that still shows the error,
 I can test it here and report back.

 jp


 Well, if one day I find a solution I will share

 Sebastien

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





 ___ 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

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


Re: [osg-users] FBO OpenGL Error with new nVidia Driver

2009-09-15 Thread Sebastien Nerig
Hi JP,

mm there is no reason, it is the version I have dowloaded when I started to 
work with OSG.
I will try to get 2.8.8 and get back.

Thank you!

Sebastien

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





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


Re: [osg-users] 3D HUD Elements

2009-09-15 Thread Andrew Burnett-Thompson
Hi Jimmy,

I just stumbled across this thread when searching for a similar solution,
and found it very interesting. Would you be prepapred to share some of your
code for a 3D Axis in the HUD? I'd understand if not.

Otherwise - what is the basic principle?

I have a HUD added to my scene as a seperate camera, this uses an ortho2D
projection and an identity view matrix as in the osgHUD example.

On this I'd like to add a 3D Axis. Should I just create the Geode for the
axis (with an update callback to reorient it) and plop it in the lower left?
Or do I require a separate HUD for the 3D element?

Thanks in advance,

Andrew

On Thu, Aug 20, 2009 at 9:04 AM, Robert Osfield robert.osfi...@gmail.comwrote:

 Hi Jimmy,

 If you are doing the frame loop you know when it's the first frame
 before you just place any viewer setup prior to the frame loop.  The
 _firstFrame code block you see if just a fallback in case the viewer
 hasn't already been setup.

 Robert.

 On Wed, Aug 19, 2009 at 10:49 PM, Jimmy Lindummy...@gmail.com wrote:
  Hi,
 
  Here is the code of frame()
 
 
  Code:
  void ViewerBase::frame(double simulationTime)
  {
 if (_done) return;
 
 if (_firstFrame)
 {
 viewerInit();
 
 if (!isRealized())
 {
 realize();
 }
 
 _firstFrame = false;
 }
 advance(simulationTime);
 
 eventTraversal();
 updateTraversal();
 renderingTraversals();
  }
 
 
 
  It calls viewerInit() on the first frame.
  Don't I need to do that myself if I expand the code?
  By looking at the viewerInit() code. I think I might be able to expand
 the code and init all the view I created.
 
  Thank you!
 
  Cheers,
  Jimmy
 
  --
  Read this topic online here:
  http://forum.openscenegraph.org/viewtopic.php?p=16447#16447
 
 
 
 
 
  ___
  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] FBO OpenGL Error with new nVidia Driver

2009-09-15 Thread J.P. Delport

Hi,

Sebastien Nerig wrote:

Hi JP,

mm there is no reason, it is the version I have dowloaded when I started to 
work with OSG.
I will try to get 2.8.8 and get back.


The fix I remembered had to do with geometry shaders, so its unrelated 
to your problem.


Like Kim also said, I think the error is more likely in the driver than 
in OSG. Upgrading to OSG 2.8.2 won't hurt though :)


I don't use Windows, but I've seen some utility to help you get rid of 
NVidia driver cruft on you machine before you install a new driver. I 
think experimenting with other driver versions is your best option.


jp



Thank you!

Sebastien

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





___
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] FBO OpenGL Error with new nVidia Driver

2009-09-15 Thread J.P. Delport

Hi,

J.P. Delport wrote:

Hi,

Sebastien Nerig wrote:

Hi JP, thanks for your answer.

The application is osgPrerender example from OSG 2.8 RC3, you surely
have already downloaded it. I didn't modify the application. I launch
it without any arguments, so the default render implementation is
FBO. The log of osgPrerender itself prints errors (see my previous
messages for a screenshot of the errors). It appears in window mode
or fullscreen mode.


Is there any reason for using 2.8 RC3 instead of 2.8.2? I vaguely 
remember something about a default shader argument being fixed after 
2.8. I'll have a look at the logs and get back to you.


I remembered an old fix for geometry shaders, so it is unrelated.

jp


--
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] shape, shape drawable and geode modification

2009-09-15 Thread Miguel Lokida
Thanks a lot. That works !

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





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


Re: [osg-users] Transparency and osg::Cone (shape)

2009-09-15 Thread Miguel Lokida
The lonely thing I would like to know is if I should make a 2 passes rendering 
using a FBO or if I add the geometry twice in the scenegraph and for each of 
them, make a transparent for the front and then a transparent for the back.

Thank you.

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





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


Re: [osg-users] FBO OpenGL Error with new nVidia Driver

2009-09-15 Thread Sebastien Nerig
Hi,


 Like Kim also said, I think the error is more likely in the driver than
 in OSG. Upgrading to OSG 2.8.2 won't hurt though :)
 
 I don't use Windows, but I've seen some utility to help you get rid of
 NVidia driver cruft on you machine before you install a new driver. I
 think experimenting with other driver versions is your best option


Yes I think it is due to GeForce 8 series drivers, but I would prefer not to to 
downgrade my drivers. Well I guess I have no solutions

thanks anyway
Sebastien

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





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


Re: [osg-users] osgvolume 2D image stack

2009-09-15 Thread Johannes van Jaarsveld
Hi Robert,

I downloaded the source to look at the code. I commented out the block of code 
starting from line 1068 directly after the comment

// assume remaining arguments are file names of textures.

up to line  in osgvolume.cpp, and rebuilt the application. After that I was 
able to build a 3D image from the 2D image stack. It looks like the code loads 
the 2D image stack, and then it looks for a 2D stack of textures...

Best Regards,
Johannes van Jaarsveld

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





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


Re: [osg-users] FBO OpenGL Error with new nVidia Driver

2009-09-15 Thread Robert Osfield
Hi Sebastien,

On Tue, Sep 15, 2009 at 1:31 PM, Sebastien Nerig overse...@hotmail.comwrote:

 Yes I think it is due to GeForce 8 series drivers, but I would prefer not
 to to downgrade my drivers. Well I guess I have no solutions


If you think like this then you'll never get on top of your problems.  You
DO have a potential solution, just you don't want to do it, this doesn't
mean you have no solution.

Also please remember that NVidia have systems for logging bugs, and fixing
them, so go chase them about it.

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


Re: [osg-users] osgvolume 2D image stack

2009-09-15 Thread Robert Osfield
Hi Johannes,

Which version of the OSG are you using?

Robert.

On Tue, Sep 15, 2009 at 2:09 PM, Johannes van Jaarsveld 
jvjaarsv...@csir.co.za wrote:

 Hi Robert,

 I downloaded the source to look at the code. I commented out the block of
 code starting from line 1068 directly after the comment

 // assume remaining arguments are file names of textures.

 up to line  in osgvolume.cpp, and rebuilt the application. After that I
 was able to build a 3D image from the 2D image stack. It looks like the code
 loads the 2D image stack, and then it looks for a 2D stack of textures...

 Best Regards,
 Johannes van Jaarsveld

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





 ___
 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] FBO OpenGL Error with new nVidia Driver

2009-09-15 Thread J.P. Delport

Hi,

Sebastien Nerig wrote:



Yes I think it is due to GeForce 8 series drivers, but I would prefer
not to to downgrade my drivers. Well I guess I have no solutions


Sometimes a downgrade can actually be an upgrade :)

jp



thanks anyway Sebastien

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






___ 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] osgvolume 2D image stack

2009-09-15 Thread Johannes van Jaarsveld
I'm using OpenSceneGraph-2.8.2 on 64 bit Fedora 11

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





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


Re: [osg-users] FBO OpenGL Error with new nVidia Driver

2009-09-15 Thread Jean-Sébastien Guay

Hi Sebastien,

Also please remember that NVidia have systems for logging bugs, and 
fixing them, so go chase them about it.


Yes Robert is right, if you've found a possible driver bug (even if it's 
only specific to one series of cards) then you can report it and they 
will probably fix it. In the last year or so there has been renewed 
interest in supporting OpenGL correctly from IHVs (nVidia, AMD, Intel) 
so it's much more likely they'll fix this kind of bug than a few years 
ago...


nVidia have been pretty responsive when I sent bug reports to 
devsupp...@nvidia.com, and included a small (compiled) example program 
that clearly demonstrated the problem. Be sure to include any data files 
the program needs, and mention the command line they need to run to 
reproduce the problem. They don't need source code, just the binary with 
all necessary DLLs and data files.


Hope this helps,

J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   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] osgvolume 2D image stack

2009-09-15 Thread Robert Osfield
Hi Johannes,

On Tue, Sep 15, 2009 at 2:21 PM, Johannes van Jaarsveld 
jvjaarsv...@csir.co.za wrote:

 I'm using OpenSceneGraph-2.8.2 on 64 bit Fedora 11


Could you try the svn/trunk version of the OpenSceneGraph as I've made a
number of improvements and bug fixes to osgVolume over the last few months.

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


[osg-users] ReaderWriters : Does the writer use libcurl?

2009-09-15 Thread Sukender
Hi all,

We're trying to write a scenegraph on a FTP. Reading is okay : it loads and 
tries the curl plugin once all other readers failed and reads successfully data 
on the FTP. But it seems the code doesn't try the curl plugin once alls 
*writers* failed. Am I wrong? Should it be implemented?
I didn't found a revealant thread in the mailing list archive... has this been 
already discussed?

Thanks!

Sukender
PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] ReaderWriters : Does the writer use libcurl?

2009-09-15 Thread Chris Denham
Hi,
I was wondering recently whether curl should always be tried FIRST for server 
addresses, for both read and write.
The reason I picked up on this was that I noticed a slight oddity with the 
existing reader plugin selection, which can end up unneccessarily trying the 
curl plugin twice when the server being accessed is down. 
It tries once when curl is one of the available plugins and then curl again 
when those all fail. Not a huge problem but it makes my program fail twice as 
slowly lol.

Of course to work round your problem, you can alway use the plugin directly via 
osgDB::Registry::instance()-getReaderWriterForExtension(curl); Though I 
think that bypasses caching mechanisms in registry.

Cheers,
Chris

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





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


[osg-users] [vpb] Specifying a patch level lower than the maximum terrain level

2009-09-15 Thread Luc Claustres
Hi,

I've tested the patching capabilities of VPB and it seems to work almost good. 
However I have a question related to min/max level specification.

I have generated a world at 500m resolution, specifying a max level of 16 
(option : -l 16). Then I patched a country at resolution 15m specifying 
different levels :
  - without the -levels option, the 15m data always appear on top of the 450m 
data
  - with the -levels 10 16 option, the 15m data appear on top of the 450m 
data only starting from a given range (level 10)
  - with the -levels 6 10 option, the 15m data always appear on top of the 
450m data except on the border of the patch where the 450m data seem to be used

The following image summarizes this : [Image: 
http://claustres.lautre.net/upload/bug-niveau-3.png ]

I wonder if the last thing is a bug or a normal behaviour ?
Indeed, I expected that the 15m data will appear at a given range (level 6) 
then disappear (level 10) to let the 450m be there again. But maybe it is 
impossible to specify a end level lower than the maximum resolution of the 
terrain.

Thank you!

Cheers,
Luc

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





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


Re: [osg-users] ReaderWriters : Does the writer use libcurl?

2009-09-15 Thread Robert Osfield
Hi Sukender,

The libcurl plugin doesn't yet support write, so this is the first thing
you'd need to implement if you want to write files over http or ftp.

Robert.

On Tue, Sep 15, 2009 at 2:44 PM, Sukender suky0...@free.fr wrote:

 We're trying to write a scenegraph on a FTP. Reading is okay : it loads and
 tries the curl plugin once all other readers failed and reads successfully
 data on the FTP. But it seems the code doesn't try the curl plugin once alls
 *writers* failed. Am I wrong? Should it be implemented?
 I didn't found a revealant thread in the mailing list archive... has this
 been already discussed?
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OSG viewer blocks Qt window

2009-09-15 Thread Zoe Catz

Philip Lowman wrote:
 Can you post a small example of the problem? 
 The problem seems to be a threading problem. I'm new to osg so probably the 
solution is pretty easy?!

Here's my sample programm which opens 1 qt and 1 osg window, but only one is 
active at the same time (in this case the osg window until I close it, then the 
qt window is active incl. my protocol in the background):


Code:
#include Settings.h
#include QtGui/QApplication
//#include Scene.h
#include osg/ShapeDrawable
#include osg/Node
#include osg/Group
#include osgViewer/Viewer
#include osgGA/TrackballManipulator

int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Settings settings;
settings.show();

//Scene* scene = new Scene();
//scene-init();
//test scene
osgViewer::Viewer viewer;
osg::ref_ptrosg::Group root (new osg::Group);
osg::ref_ptrosg::Geode boxGeode (new osg::Geode);
osg::ref_ptrosg::Box box (new osg::Box(osg::Vec3f(2,0,0), 0.4, 0.4, 0.4));
osg::ref_ptrosg::ShapeDrawable boxDrawable (new 
osg::ShapeDrawable(box.get()));
boxGeode-addDrawable(boxDrawable.get());
root-addChild(boxGeode.get());
viewer.setSceneData( root.get());
viewer.setCameraManipulator(new osgGA::TrackballManipulator());
viewer.setUpViewInWindow(150,150,800,600);
viewer.run();

return app.exec();
}




Philip Lowman wrote:
 Have you considered using something like a QTimer to send your keep-alive 
 messages instead?

I did, but I really want to avoid to spend time on understanding the dmx artnet 
protocoll and it's polling policy, especially as it works completely 
automatically in other applications.

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





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


Re: [osg-users] OSG viewer blocks Qt window

2009-09-15 Thread Robert Osfield
Hi Zoe,

viewer.run() runs an frame loop till the viewer has it's done flag set, very
much in the same way that QApplication::exec() runs it's event loop till
exit.  It's not that Qt and OSG aren't compatible, it's just this two very
high level convenience functions both assume control of the main thread.

You have lots of options available to you, which is most appropriate depends
a great deal on what you want to do with your app.  One route would be to
run the OSG's main thread in it own thread, another route would be to write
the frame loop and then prod the Qt events queue on each new frame, another
would be to use a Qt timer to call the Viewer::frame().

The best real-time solution would be to use a separate thread to run the
viewer's frame loop.  I've attached part of example that hasn't yet made it
into the core OpenSceneGraph distribution, but uses either the frame loop
thread or interleaving of the Qt and OSG in one main thread.  The key bits
of interest are:

if (useFrameLoopThread)
{
// create a thread to run the viewer's frame loop
ViewerFrameThread viewerThread(viewer.get(), true);
viewerThread.startThread();

// no start the standard Qt event loop, then exists when the
viewerThead sends the QApplication::exit() signal.
return QApplication::exec();

}
else
{
// run the frame loop, interleaving Qt and the main OSG frame loop
while(!viewer-done())
{
// process Qt events - this handles both events and paints the
browser image
QCoreApplication::processEvents(QEventLoop::AllEvents, 100);

viewer-frame();
}

return 0;
}

Hope this helps,
Robert.


On Tue, Sep 15, 2009 at 3:47 PM, Zoe Catz small_dra...@gmx.net wrote:


 Philip Lowman wrote:
  Can you post a small example of the problem?
  The problem seems to be a threading problem. I'm new to osg so probably
 the solution is pretty easy?!

 Here's my sample programm which opens 1 qt and 1 osg window, but only one
 is active at the same time (in this case the osg window until I close it,
 then the qt window is active incl. my protocol in the background):


 Code:
 #include Settings.h
 #include QtGui/QApplication
 //#include Scene.h
 #include osg/ShapeDrawable
 #include osg/Node
 #include osg/Group
 #include osgViewer/Viewer
 #include osgGA/TrackballManipulator

 int main(int argc, char *argv[])
 {
 QApplication app(argc, argv);
 Settings settings;
 settings.show();

 //Scene* scene = new Scene();
 //scene-init();
 //test scene
 osgViewer::Viewer viewer;
 osg::ref_ptrosg::Group root (new osg::Group);
 osg::ref_ptrosg::Geode boxGeode (new osg::Geode);
 osg::ref_ptrosg::Box box (new osg::Box(osg::Vec3f(2,0,0), 0.4, 0.4,
 0.4));
 osg::ref_ptrosg::ShapeDrawable boxDrawable (new
 osg::ShapeDrawable(box.get()));
 boxGeode-addDrawable(boxDrawable.get());
 root-addChild(boxGeode.get());
 viewer.setSceneData( root.get());
 viewer.setCameraManipulator(new osgGA::TrackballManipulator());
 viewer.setUpViewInWindow(150,150,800,600);
 viewer.run();

 return app.exec();
 }




 Philip Lowman wrote:
  Have you considered using something like a QTimer to send your keep-alive
 messages instead?

 I did, but I really want to avoid to spend time on understanding the dmx
 artnet protocoll and it's polling policy, especially as it works completely
 automatically in other applications.

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





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

/* OpenSceneGraph example, osgcompositeviewer.
*
*  Permission is hereby granted, free of charge, to any person obtaining a copy
*  of this software and associated documentation files (the Software), to deal
*  in the Software without restriction, including without limitation the rights
*  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
*  copies of the Software, and to permit persons to whom the Software is
*  furnished to do so, subject to the following conditions:
*
*  THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
*  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
*  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
*  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
*  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
*  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
*  THE SOFTWARE.
*/

#include iostream

#include osg/Notify
#include osg/io_utils

#include osg/ArgumentParser
#include osgDB/WriteFile
#include osgGA/TrackballManipulator
#include osgGA/StateSetManipulator
#include osgViewer/Viewer
#include osgViewer/ViewerEventHandlers
#include osgWidget/Browser


#include 

Re: [osg-users] ReaderWriters : Does the writer use libcurl?

2009-09-15 Thread Sukender
Hi Chris, Hi Robert,

Okay, so if I sum up:
- I need to code a call to the libcurl plugin
- I need to code the write part of the libcurl plugin

I don't know if the decision to code it soon will be taken. Let's bet it won't 
before a long time...

Well anyway, as reading from a stream (FTP) seems okay in our 3DS reader, and 
as 3DS writing seems okay for files, then I'll submit our 3DS reader/writer 
soon (a few days I guess). In the case you're waiting for it (maybe one or two 
persons around here?!?)...

Sukender
PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/

- Robert Osfield robert.osfi...@gmail.com a écrit :

 Hi Sukender,
 
 The libcurl plugin doesn't yet support write, so this is the first
 thing you'd need to implement if you want to write files over http or
 ftp.
 
 Robert.
 
 
 On Tue, Sep 15, 2009 at 2:44 PM, Sukender  suky0...@free.fr  wrote:
 
 
 We're trying to write a scenegraph on a FTP. Reading is okay : it
 loads and tries the curl plugin once all other readers failed and
 reads successfully data on the FTP. But it seems the code doesn't try
 the curl plugin once alls *writers* failed. Am I wrong? Should it be
 implemented?
 I didn't found a revealant thread in the mailing list archive... has
 this been already discussed?
 
 
 
  
 
 
   
 ___
 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] ReaderWriters : Does the writer use libcurl?

2009-09-15 Thread Robert Osfield
Hi Sukender,

On Tue, Sep 15, 2009 at 4:00 PM, Sukender suky0...@free.fr wrote:

 - I need to code a call to the libcurl plugin


Possibly not.  It should be possible to get the Registry to fallback to
using the curl plugin in the same way as it works for reading.  Or your just
preload the curl plugin so it's checked first.


 - I need to code the write part of the libcurl plugin

 I don't know if the decision to code it soon will be taken. Let's bet it
 won't before a long time...


I don't have any plans to add write support to the libcurl myself, but
others are welcome to scratch the itch ;-)

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


Re: [osg-users] [osgPlugins] Error when loading DirectX .x files

2009-09-15 Thread Judy Hartley
Thanks, Ulrich!


That helps a lot.  I had finally found a different method use, i.e. converting 
the .x files into .obj files (of course I had to write a conversion script 
first) but the load time was getting bad.  Then I found the osgconv tool and 
converted all of my .obj files into .ive files and it's amazing how fast they 
load!

I'm going to test and see whether the .x files load faster, but I kind of doubt 
it.

Cheers,
Judy

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





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


Re: [osg-users] [osgPlugins] Error when loading DirectX .x files

2009-09-15 Thread Jason Daly

Judy Hartley wrote:

Thanks, Ulrich!


That helps a lot.  I had finally found a different method use, i.e. converting 
the .x files into .obj files (of course I had to write a conversion script 
first) but the load time was getting bad.  Then I found the osgconv tool and 
converted all of my .obj files into .ive files and it's amazing how fast they 
load!

I'm going to test and see whether the .x files load faster, but I kind of doubt 
it.
  


Yeah, that's not likely.  The main purpose for the .ive format is to 
reduce load time  :-)


.ive is the native binary format for OSG, so it pretty much goes 
straight from disk to memory.


--J

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


[osg-users] Precipitation without using shaders

2009-09-15 Thread Cristina Paponi
Hi,

I need to implement precipitation on a system that doesn't support shaders. Is 
there anybody that has an example of precipitation in OSG without using 
shaders? 

Thank you!

Cheers,
Cristina

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





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


Re: [osg-users] Problems port OSG 1.0 - 2.8.2; Can't embed viewer in external app

2009-09-15 Thread Natasha Westland
The osgviewerGTK example does work but that embeds the viewer in its own 
application.  I have tried modifying the OSGGTKDrawingArea class so that 
it would work given my scenario but to no avail (for example, I can't 
just open a gtk dialog when instantiating an OSGGTKDrawingArea object.  
I tried modifying the appropriate methods so instead of creating a new 
window, it embeds itself using the code in my below example but I get 
the same behavior).  The viewer is created, embedded in the GTK 
application and then is never seen again. 

The reason for the upgrade from OSG 1.0 to 2.8.2 was due to the upgrade 
of our OS (from FC 5 to CentOS).  The underlying libraries were newer 
and mandated the upgrade.  Thanks for the response.


Natasha

jp wrote:


Hi,

does the osgviewerGTK example work?

jp


Natasha Westland wrote:


 Hello,

 I am having difficulties upgrading from OSG 1.0 to 2.8.2 (on CentOS) and
 was hoping to tap into this wealth of knowledge
 after failing miserably poking around the source code and attempting to
 retrofit the example applications into my own.

 Using OSG 1.0, I have an application which used an osgProducer to embed
 a viewer in another (GTK+ based) application. Using the below approach,
 I am able to successfully render images in the external application.  In
 my attempt to port to OSG 2.8.2,
 I am able to embed the viewer in the external application but I can't
 seem to render any images.  (I've tried simply changing the
 background color and that doesn't work either.)  Based on observations
 in the debugger,  it appears that my viewer may not be
 integrated properly with the gtk redrawing thread of the external
 application due to the fact that the visible (black) view is
 overdrawn by the external application at random times, and it is never
 seen again.  Any pointers would be greatly appreciated. Thanks!

 Natasha
 westl...@ll.mit.edu

 _ Initialization of osgProducer viewer using OSG 1.0:  _

osgProducer::Viewer viewer (BuildConfig());
viewer.setUpViewer (osgProducer::Viewer::SKY_LIGHT_SOURCE |

 osgProducer::Viewer::HEAD_LIGHT_SOURCE |

 osgProducer::Viewer::STATE_MANIPULATOR |

 osgProducer::Viewer::STATS_MANIPULATOR |

 osgProducer::Viewer::VIEWER_MANIPULATOR );
  gtk_init (argc, argv);

  // set the xid of the GtkSocket and connect the GtkPlug
  guint32 xid = wGtkPlug;// gtksocket of external application
  GtkWidget *plug = gtk_plug_new(xid);
  gtk_signal_connect(GTK_OBJECT(plug), destroy-event,
 GTK_SIGNAL_FUNC(destroy_event), viewer);

  // set the viewer to display in the plug

 
viewer.getCamera(0)-getRenderSurface()-setWindow(gtk_plug_get_id(GTK_PLUG(plug)));


 // create a new thread to handle GTK events
  pthread_create(gtk_thread, NULL, gtk_thread_loop, NULL);

// create the windows and run the threads.
viewer.realize();

while( !viewer.done() ) {
viewer.sync();
viewer.update();
 // fire off the cull and draw traversals of the scene.
 viewer.frame();
 usleep(50);
 }

Producer::CameraConfig*
BuildConfig(void) {
Producer::RenderSurface *rs1 = new Producer::RenderSurface;
rs1-setScreenNum(0);
rs1-setWindowName(external-app);
rs1-setWindowRectangle (0,0,640,480);
Producer::Camera *camera1 = new Producer::Camera;
camera1-setRenderSurface(rs1);
camera1-setOffset( 0.0, 0.0 );
rs1-setInputRectangle
 (Producer::RenderSurface::InputRectangle(0.0,1.0,0.0,1.0));
Producer::InputArea *ia = new Producer::InputArea;
ia-addRenderSurface(rs1);
Producer::CameraConfig *cfg = new Producer::CameraConfig;
cfg-addCamera(Camera 1,camera1);
cfg-setInputArea(ia);
return cfg;
}

  void *gtk_thread_loop(void *arg) {
  gtk_main();
  return NULL;
   }


 _ Rendering the images in OSG 1.0 is implemented as follows (same
 for OSG 2.8.2): _

_loadedModel = osgDB::readNodeFile(sName);
if (!_loadedModel) {
  viewer.setClearColor( osg::Vec4( 0.9f, 0.9f, 0.9f, 1.0) );
  return 1;
}
viewer.setClearColor( osg::Vec4( 0.701961f, 0.862745f, 0.949020f,
 1.0) );

// optimize the scene graph, remove rendundent nodes and state etc.
osgUtil::Optimizer optimizer;
optimizer.optimize(_loadedModel.get());
  //add the model to the transform.
_modelTransform.get()-addChild(_loadedModel.get());

// set the scene to render
viewer.setSceneData(_rootNode.get());

 _ Initialization in OSG 2.8.2 is below: HELP - what am I doing
 wrong? _

osgViewer::Viewer viewer;

osg::ref_ptrosg::GraphicsContext::Traits traits = new
 osg::GraphicsContext::Traits;
traits-screenNum = 0;
traits-x = 0;
traits-y = 0;
traits-width = 640;
traits-height = 480;
traits-red = 8;
traits-blue = 8;
traits-green = 8;
traits-alpha = 0;
traits-windowDecoration = false;
traits-pbuffer = 

Re: [osg-users] Problems port OSG 1.0 - 2.8.2; Can't embed viewer in external app

2009-09-15 Thread Jason Daly

Natasha Westland wrote:
The osgviewerGTK example does work but that embeds the viewer in its 
own application.  I have tried modifying the OSGGTKDrawingArea class 
so that it would work given my scenario but to no avail (for example, 
I can't just open a gtk dialog when instantiating an OSGGTKDrawingArea 
object.  I tried modifying the appropriate methods so instead of 
creating a new window, it embeds itself using the code in my below 
example but I get the same behavior).  The viewer is created, embedded 
in the GTK application and then is never seen again. 

The reason for the upgrade from OSG 1.0 to 2.8.2 was due to the 
upgrade of our OS (from FC 5 to CentOS).  The underlying libraries 
were newer and mandated the upgrade.  Thanks for the response.


I'm very likely going to have to do something similar soon.  We're 
already using 2.8, but we're also currently using a home-made viewer and 
using osgUtil::SceneView directly.  This works, but has some issues (no 
threading, have to set up the DatabasePager manually, etc).  A lot of 
our apps are GTK-based as well.


If I get a chance, I'll try to implement some of my ideas and I'll pass 
along anything I learn.


--J

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


[osg-users] LineSegmentIntersector, IntersectionVisitor and children

2009-09-15 Thread Julien-Charles Levesque
Hi,

I am using LineSegmentIntersectors with IntersectionVisitor to do some ray 
casting in my architecture. Everything works fine to select and move objects. 
However I want to implement a drag-and-drop interaction, where I can move an 
object onto another and have something different happen. I want to obtain this 
object using the ray casting as well, so I cast a ray and check to get the 
first object in Intersections that is not my current object (which I saved in a 
member variable at the beginning of my drag-and-drop). 

It all works fine until I start interacting with parent/child objects. I have a 
sphere and a cube, the sphere is the parent of the cube. When I drag-and-drop 
my cube over black space, the IntersectionVisitor returns me the sphere (the 
parent) as the second object intersected even though there is nothing behind 
the cube at the place I dropped it. 

Now I believe this has something to do with the parent's bounding sphere 
including it's children and thus being counted as an intersection, but I'm not 
sure how I can deal with this kind of stuff. Then again, I could be mistaken.

I tried reading about bounding spheres in the reference guide and did not see 
much, neither could I get much information (or enough information ;) about 
IntersectionVisitors.. any help would be strongly appreciated !


Thanks in advance !

Sincerely,
Julien-Charles

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





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


[osg-users] Huge triangle mesh / Geometry Clipmap

2009-09-15 Thread David Angelo
Hi folks,

I am starting to work on a project, where I have to render and manipulate huge
triangle meshes (~200 mio. vertices).
The meshes are seismic horizons, which are quite similar to ordinary terrain
meshes. However, theses meshes can and will have holes.
I think both VPN and osgEarth (which are pretty cool and I used them in
different contexts) are not suited for this purpose.
For the rendering part, my first idea was to use the Geometry Clipmap:
http://research.microsoft.com/en-us/um/people/hoppe/geomclipmap.pdf
technique by Losasso  Hoppe. Has anybody already implemented it (preferably
with OSG), or does anybody know if this technique supports meshes with holes?
Perhaps an integration of this technique into VPB would also be worth thinking
of.
What do you think?

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


Re: [osg-users] Focus object/scene (clamping frustum)

2009-09-15 Thread Johannes Schüth
Hi,

I see. Of course thats very simple. I had something much more complicated in my 
mind. (Checking if the frustum planes intersect with some bounding box lines or 
so..) 
Anyway..

Here is my solution:


Code:

osg::Vec3f eye, center, up;
float n;
viewA1-getCamera()-getViewMatrixAsLookAt(eye, center, up, n);
//printf(r: %f\n,boundingSphere._radius);
double d = (boxCenter - eye).length();
double fovy = osg::RadiansToDegrees(atan(boundingSphere._radius/d))*2;
double aspectratio = 1.0;
double znear = 1.;
double zfar = 1000.;
viewA1-getCamera()-setProjectionMatrixAsPerspective(fovy,
aspectratio, znear, zfar);




(Of course you can compute the znear and zfar as well by using d and d+radius.)

Cheers,
Johannes

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





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


Re: [osg-users] Ann: osgBoostPython

2009-09-15 Thread Martin Mueller

Hi Jean-Sébastien,

I like your approach. The python interface has a good pythonic feeling, 
subclassing NodeVisitor works fine and building up geometry does also 
work fine! I'm definitely going to contribute to this.
I'm working on wrapping some methods of osg::Camera just now. I can also 
point you to the Delta3D project. They have wrappers for osg::Matrix, 
not the most pythonic ones, but it might be helpful.


Greetings,
Martin


Jean-Sébastien Guay wrote:

Hi all,

I'd like to announce the initial availability of osgBoostPython, a very 
work-in-progress python wrapping of OSG.


The project is on Google Code here:
http://code.google.com/p/osgboostpython/

Seeing how osgSwig had its problems wrapping recent versions of OSG, and 
wanting to do something completely different than what I do at work 
during my vacation, I started working on this. At the moment, I have 
some of osg, osgDB, osgGA and osgViewer wrapped, such that I can do the 
following completely in python code:


1. Create simple node hierarchies (osg::Node, osg::Group, osg::Geode, 
osg::Drawable, osg::Geometry, osg::ShapeDrawable)

2. Read various files (osgDB::readNodeFile, readImageFile, readShaderFile)
3. Create osg::Geometry with Vec2, Vec3 and Vec4 Arrays for vertices, 
texcoords, vertex colors and normals.
4. Set modes in a stateset and add a texture to a stateset (the only 
StateAttribute currently wrapped)
5. Start a viewer (osgViewer::Viewer) with different windowing setups 
(osgViewer::View)
6. Override osg::NodeCallback, osg::NodeVisitor and 
osgGA::GUIEventHandler in python subclasses (the enums from 
osgGA::GUIEventAdapter for key and event type have not yet been wrapped 
but this is trivial to add and will be added soon)
7. A few more that I surely forget. See the test/ directory in the code 
for some python-scripted unit tests, I try to keep these complete so 
they represent what can currently be done with the wrappers.


Lots of things are missing to make a useful application from this, and 
no performance tests have been done either (I suspect if you make a 
NodeCallback in python code, it would have to be pretty simple, but I 
have no numbers). Also, some basic tests are in the code base but some 
things are known not to work (ref_ptr gives me a bit of trouble 
sometimes), so more unit tests would be helpful.


The manual wrapping is a bit tedious to do but it has some definite 
advantages (you wrap what you need as you need it, and things are simple 
to wrap including VecXArrays).


The project's name comes from the fact that it uses Boost.Python to do 
the wrapping. Boost.Python is a way to wrap C++ libraries into Python 
modules using C++ code (boost's heavily-template metaprogramming style 
of code). As such, it uses bjam as a built tool instead of CMake, but 
anyone who has boost should have bjam too so it shouldn't be a problem. 
More info on Boost.Python can be found here:

http://www.boost.org/doc/libs/1_40_0/libs/python/doc/index.html

Essentially, I'm announcing this so people can take a look, give me 
comments, and if anyone would like to help in the initial stages I'll 
gladly accept patches. If someone wants to contribute in a more major 
way I could also give commit access to some.


I don't think I'll ever compete with osgSwig, since the focus of this 
project will likely be different. I doubt it will ever feature complete 
wrapping of all of OSG. However, it can be useful to people who want 
certain features and want lots of control over how the OSG API is 
exposed to Python.


I'll be back to regular work on Monday, so I have no idea how often 
I'll be able to work on this (it may be quite sporadic). But I'll gladly 
answer questions and review patches.


If you want to help, you can check the code and see the 
WrappingCookbook page on the project wiki to see how to continue 
wrapping. Also see the project's Issues section for some of the things I 
wanted to tackle next (but any additional wrapping will be useful). The 
README.txt in the repository explains how to build and then how to run 
the unit tests.


Hope this can be useful to someone someday. Let me know if there are 
questions or comments.


J-S


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


Re: [osg-users] [build] OSX 10.6.1 Snow Leopard woes

2009-09-15 Thread E. Wing
I am not currently on the OSG track so I'm afraid I can't be much help
at the moment. But be aware that in Snow Leopard, the default
architecture is 64-bit (assuming you are on a 64-bit machine which
almost all Intel Macs are now). All the Carbon stuff in
osgViewerCarbon will likely not compile in 64-bit. I thought there was
at least a preliminary Cocoa based viewer now, but I haven't been
following. It seems like the Cocoa one needs to be made the default
for just this problem that people are going to encounter over and over
again. (Also, if my ImageIO plugin has not been integrated yet, now is
the time do so so as the Quicktime plugin is also not going to work in
64-bit.)

Second, I don't know if the Xcode project is maintained anymore.

Third for CMake, you'll want to verify which architectures are trying
to be built. If you pick the 10.5 SDK and i386 (32-bit), I would think
you would have the best chance of it actually getting built as-is.

-Eric



On 9/15/09, stefan nortd ste...@nortd.com wrote:
 Hi,

 I just updated to osx 10.6.1 snow leopard and ran into a couple of
 problems.

 (1) My old osg binaries (osg 2.8.2 compiled for the 10.5 sdk) work but I
 get a ton of warning (I also needed to update to xcode 3.2). They are all
  of the different visibility type.

 (2) Osg does not want to compile on osx 10.6. I tried both Xcode and
 Makefiles. And for each I tried the 10.5 and 10.6 sdk which does not seem
  to change the nature of the compilation error.

 The attached screenshots are the errors I get with xcode.

 The following code snippet is the errors I get with the Makefiles. It gets
 25% into the build and fails with the osgViewer.


 Code:

 Scanning dependencies of target osgViewer
 [ 25%] Building CXX object
 src/osgViewer/CMakeFiles/osgViewer.dir/CompositeViewer.cpp.o
 [ 25%] Building CXX object
 src/osgViewer/CMakeFiles/osgViewer.dir/HelpHandler.cpp.o
 [ 25%] Building CXX object
 src/osgViewer/CMakeFiles/osgViewer.dir/Renderer.cpp.o
 [ 25%] Building CXX object
 src/osgViewer/CMakeFiles/osgViewer.dir/Scene.cpp.o
 [ 25%] Building CXX object
 src/osgViewer/CMakeFiles/osgViewer.dir/ScreenCaptureHandler.cpp.o
 [ 25%] Building CXX object
 src/osgViewer/CMakeFiles/osgViewer.dir/StatsHandler.cpp.o
 [ 25%] Building CXX object
 src/osgViewer/CMakeFiles/osgViewer.dir/Version.cpp.o
 [ 26%] Building CXX object src/osgViewer/CMakeFiles/osgViewer.dir/View.cpp.o
 [ 26%] Building CXX object
 src/osgViewer/CMakeFiles/osgViewer.dir/Viewer.cpp.o
 [ 26%] Building CXX object
 src/osgViewer/CMakeFiles/osgViewer.dir/ViewerBase.cpp.o
 [ 26%] Building CXX object
 src/osgViewer/CMakeFiles/osgViewer.dir/ViewerEventHandlers.cpp.o
 [ 26%] Building CXX object
 src/osgViewer/CMakeFiles/osgViewer.dir/GraphicsWindowCarbon.cpp.o
 In file included from
 /Users/noema/Downloads/OpenSceneGraph-2.8.2/src/osgViewer/GraphicsWindowCarbon.cpp:18:
 /Users/noema/Downloads/OpenSceneGraph-2.8.2/include/osgViewer/api/Carbon/GraphicsWindowCarbon:122:
 warning: ‘AGLDrawable’ is deprecated (declared at
 /System/Library/Frameworks/AGL.framework/Headers/agl.h:48)
 /Users/noema/Downloads/OpenSceneGraph-2.8.2/include/osgViewer/api/Carbon/GraphicsWindowCarbon:128:
 warning: ‘AGLDrawable’ is deprecated (declared at
 /System/Library/Frameworks/AGL.framework/Headers/agl.h:48)
 /Users/noema/Downloads/OpenSceneGraph-2.8.2/include/osgViewer/api/Carbon/GraphicsWindowCarbon:132:
 warning: ‘AGLDrawable’ is deprecated (declared at
 /System/Library/Frameworks/AGL.framework/Headers/agl.h:48)
 /Users/noema/Downloads/OpenSceneGraph-2.8.2/src/osgViewer/GraphicsWindowCarbon.cpp:
 In function ‘OSStatus GraphicsWindowEventHandler(OpaqueEventHandlerCallRef*,
 OpaqueEventRef*, void*)’:
 /Users/noema/Downloads/OpenSceneGraph-2.8.2/src/osgViewer/GraphicsWindowCarbon.cpp:75:
 error: ‘GetWindowPortBounds’ was not declared in this scope
 /Users/noema/Downloads/OpenSceneGraph-2.8.2/src/osgViewer/GraphicsWindowCarbon.cpp:75:
 error: ‘InvalWindowRect’ was not declared in this scope
 /Users/noema/Downloads/OpenSceneGraph-2.8.2/src/osgViewer/GraphicsWindowCarbon.cpp:76:
 error: ‘GetWindowBounds’ was not declared in this scope
 /Users/noema/Downloads/OpenSceneGraph-2.8.2/src/osgViewer/GraphicsWindowCarbon.cpp:
 In constructor ‘osgViewer::MenubarController::MenubarController()’:
 /Users/noema/Downloads/OpenSceneGraph-2.8.2/src/osgViewer/GraphicsWindowCarbon.cpp:231:
 error: ‘DMGetGDeviceByDisplayID’ was not declared in this scope
 /Users/noema/Downloads/OpenSceneGraph-2.8.2/src/osgViewer/GraphicsWindowCarbon.cpp:232:
 error: ‘GetAvailableWindowPositioningBounds’ was not declared in this scope
 /Users/noema/Downloads/OpenSceneGraph-2.8.2/src/osgViewer/GraphicsWindowCarbon.cpp:
 In member function ‘void osgViewer::MenubarController::update()’:
 /Users/noema/Downloads/OpenSceneGraph-2.8.2/src/osgViewer/GraphicsWindowCarbon.cpp:296:
 error: ‘GetWindowBounds’ was not declared in this scope
 /Users/noema/Downloads/OpenSceneGraph-2.8.2/src/osgViewer/GraphicsWindowCarbon.cpp:
 In 

Re: [osg-users] osgvolume 2D image stack

2009-09-15 Thread Johannes van Jaarsveld
Thanks Robert, will do so

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





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