Re: [osg-users] empty scene after resize

2008-07-15 Thread Michele Bosi
I just wanted to let you know how I solved my problem: it seems that
one has to avoid sending the resize events to OSG when the new size
has zero area, that is, the width or height are == 0. Basically I just
put the condition if ( width * height ) in the Qt's resize event
handler before dispatching the resize event to OSG.

Cheers,
Michele

On Mon, Jul 14, 2008 at 11:08 PM, Robert Osfield
[EMAIL PROTECTED] wrote:
 Hi Michele,

 This most likely will be because the viewport is going to 0,0,0,0 size
 and messing up projection matrix.  I'm afraid I don't have an straight
 forward solutions to this - it most likely will require so special
 catch code to handle this problem case.

 Robert.

 On Mon, Jul 14, 2008 at 10:05 PM, Michele Bosi [EMAIL PROTECTED] wrote:
 I am sure this is a known problem, but looking on the archives didn't
 help, maybe I didn't come up with the right keywords, anyway... I am
 using OSG 2.4 (but the problem was already there since OSG 2.0) under
 both Win XP and Linux, with the Qt4 wrapper and when I resize the
 window to zero width or height and then restore it the content of the
 scene disappears (my program has 3d views that can be temprarily
 hidden/restored). This behaviour seem not to be related to the driver
 but to OSG since with OSG-based programs I get the same problem with
 nVidias as well as with ATIs, while other non-OSG-based programs don't
 show this problem.

 I suspect that with a zero-area viewport something breaks into the
 culling mechanism or some division by zero mixes up some OSG internal
 state or matrix.
 Does anyone know how to fix or work around this? do I have to reset
 something once I detect a non-zero area viewport in my resize event
 handler?

 Thanks,
 Michele
 ___
 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] empty scene after resize

2008-07-14 Thread Michele Bosi
I am sure this is a known problem, but looking on the archives didn't
help, maybe I didn't come up with the right keywords, anyway... I am
using OSG 2.4 (but the problem was already there since OSG 2.0) under
both Win XP and Linux, with the Qt4 wrapper and when I resize the
window to zero width or height and then restore it the content of the
scene disappears (my program has 3d views that can be temprarily
hidden/restored). This behaviour seem not to be related to the driver
but to OSG since with OSG-based programs I get the same problem with
nVidias as well as with ATIs, while other non-OSG-based programs don't
show this problem.

I suspect that with a zero-area viewport something breaks into the
culling mechanism or some division by zero mixes up some OSG internal
state or matrix.
Does anyone know how to fix or work around this? do I have to reset
something once I detect a non-zero area viewport in my resize event
handler?

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


Re: [osg-users] Realistic Explosions needed!

2008-05-29 Thread Michele Bosi
Hi Neusch,
a technique that is often used in videogames is a mix of particle
systems and animated sprites/texture.
Usually you start by rendering an animated explosion using Maya or 3D
Studio then the animation is exported as a set of textures which will
be used later. In your simulation your explosion will be a billboard
whose texture is animated using the previously rendered textures. To
achieve a more realistic effect then you add one or more particle
systems that simulate debris scattered around with its smoke trail and
maybe a couple of small polygonal objects projected away from the
explosion.
By adding more animated billboards symultaneously with different
pre-rendered explosions you can achieve quite impressive effects. Of
course the final result of this technique depends on the skill of your
Maya/3D Studio/Blender modeller.

A variant of this technique is to procedurally generate your animated
texture, you could start from a noise function or game-of-like kind of
function or a more physically correct algorithm that simulates fire.

You might also be interested in the Vulcan Demo by Hubert Nguyen
from NVIDIA: http://http.developer.nvidia.com/GPUGems/gpugems_ch06.html

Regards,
Michele

On Wed, May 28, 2008 at 2:40 PM, Neusch, Dominik, SDGE1
[EMAIL PROTECTED] wrote:
 Hi,



 I am just programming a special effects module that uses OpenSceneGraph.
 What I need is an explosion or explosion effect that looks as good and
 realistic as possible. First thing I tried was the
 osgParticle::ExplosionEffect. Its ok, but I need something that looks like
 the explosion on the image that I have attached to this mail.

 Next thing I tried was the Delta3D Particle Editor. The result was much
 better, but still not enough. It is very difficult to add fragments to the
 explosion that fly away with a smoke trail behind. For example is it not
 possible to add an emitter to the fragment.

 I also tried the OSG Exporter for 3ds max. But the exporter only exports
 spray and snow particle systems, and in my opinion it is not possible to
 design good looking explosions with that two particle systems. Furthermore
 the two particle systems were not exported correctly, so I gave it up.

 Is there another possibility to create realistic explosion effects with OSG?
 Or did somebody have success in exporting an explosion from 3ds max to OSG?



 Any ideas?



 Thanks,



 Dominic Neusch



 
 Dominic Neusch
 Diplomand

 EADS
 Defence  Security
 System Design Center Germany - SDGE1
 88039 Friedrichshafen - Deutschland
 Telephone: +49 (0) 7545 8-2686
 Fax: +49 (0) 7545 8-9630
 Email: mailto:[EMAIL PROTECTED]

 www.eads.com

 EADS Deutschland GmbH
 Registered Office: Ottobrunn
 District Court of Munich HRB 107 648
 Chairman of the Supervisory Board: Dr. Thomas Enders
 Managing Directors: Dr. Stefan Zoller (chairman), Michael Hecht

 This E-mail and any attachment(s) to it are for the addressee's use only.
 It is strictly confidential and may contain legally privileged information.
 No confidentiality or privilege is waived or lost by any mistransmission.
 If you are not the intended addressee, then please delete it from your
 system and notify the sender immediateley. You are hereby notified that any
 use,
 disclosure, copying or any action taken in reliance on it is strictly
 prohibited and may be unlawful. - Thank you.

 Before printing this e-mail, think about our environmental responsibility



 ___
 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] Small object frustum culling

2008-05-23 Thread Michele Bosi
Hi all,
I have a scene with 4000 billboarded quads to display and I just
noticed that OSG might not perform frustum culling on them since Fraps
tells me that the FPS remains the same even when many of those quads
are out of the screen.

Is there a way to enable frustum culling? or maybe OSG doesn't perform
frustum culling for small/simple objects?

I am currently using OSG 2.2 / WinXP / MinGW and the application I am
using manages the camera with a Trackball manipulator, in case this
has anything to do with the problem...

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


Re: [osg-users] Small object frustum culling

2008-05-23 Thread Michele Bosi
Thank you Robert,
v-sync is off, I get around 90-100 FPS, when enabled OSG stats I get
3.4 for cull and 6.4 for draw, also in this case the frame rate
basically does not change but floats around the same range 90-100.
Since the performances are already very good I wont dig more into the
problem, which might not be a problem but rather a lack of
understanding of what's going on.

Another thing: I instance a single Geometry (my quad billboard) then
add it 4000 times to a Billboard node. I looked in the archives for
quadtree but coulnd't find any info. How can I use the quadtrees you
mentioned with OSG? Did you mean quadtrees to speedup frustum culling
or a particular parent/child layout for OSG nodes?

Thanks,
Michele

On Fri, May 23, 2008 at 4:05 PM, Robert Osfield
[EMAIL PROTECTED] wrote:
 Hi Michele,

 The OSG does view frustum culling by default, you have to explictly
 turn it off.  The same applies to small feature culling it's on by
 default.

 As for your FPS not changing when objects move off screen, is vsync?

 Hows about enabling OSG stats?  This will tell you what the bottleneck.

 Also with your scene graph, make sure you build a quad tree to store
 all those billboards, and avoid large flat node contains lots of
 children/drawables.

 Robert.

 On Fri, May 23, 2008 at 3:01 PM, Michele Bosi [EMAIL PROTECTED] wrote:
 Hi all,
 I have a scene with 4000 billboarded quads to display and I just
 noticed that OSG might not perform frustum culling on them since Fraps
 tells me that the FPS remains the same even when many of those quads
 are out of the screen.

 Is there a way to enable frustum culling? or maybe OSG doesn't perform
 frustum culling for small/simple objects?

 I am currently using OSG 2.2 / WinXP / MinGW and the application I am
 using manages the camera with a Trackball manipulator, in case this
 has anything to do with the problem...

 Thanks,
 Michele
 ___
 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] Small object frustum culling

2008-05-23 Thread Michele Bosi
On Fri, May 23, 2008 at 5:06 PM, Robert Osfield
[EMAIL PROTECTED] wrote:
 Hi Michele,

 On Fri, May 23, 2008 at 3:58 PM, Michele Bosi [EMAIL PROTECTED] wrote:
 Thank you Robert,
 v-sync is off, I get around 90-100 FPS, when enabled OSG stats I get
 3.4 for cull and 6.4 for draw, also in this case the frame rate
 basically does not change but floats around the same range 90-100.
 Since the performances are already very good I wont dig more into the
 problem, which might not be a problem but rather a lack of
 understanding of what's going on.

 Another thing: I instance a single Geometry (my quad billboard) then
 add it 4000 times to a Billboard node. I looked in the archives for
 quadtree but coulnd't find any info. How can I use the quadtrees you
 mentioned with OSG? Did you mean quadtrees to speedup frustum culling
 or a particular parent/child layout for OSG nodes?

 I'm afraid I can't teach you about general real-time graphics work I
 have enough on my plate.


Thank you Robert, I know you are swamped of work and deliver for free
a great service to the list, but I am afraid you don't need to teach
me anything about quadtrees, I regularly work with quadtrees and
octrees and implemented several of them.

 There are lots of books and online resources on items like quad trees.
  Lots in the archives too.


I looked in the archives through this web page:
http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/
and there are exactly 0 results for quadtree and quad-tree.

My question was very clear, and it has to do a lot with OSG and a few
with quadtrees but probably it was a misunderstanding.

In your mail you said: Also with your scene graph, make sure you
build a quad tree to store all those billboards, and avoid large flat
node contains lots of children/drawables.
Did you mean, OSG has a quadtree class somewhere, use it or
implement your own quadtree scene graph management, integrate it with
OSG culling mechanics, and put your billboards in it?

Michele

 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] Small object frustum culling

2008-05-23 Thread Michele Bosi
Thank you Paul(s), Stefan and Gordon,
yes now I am pretty sure that Robert by quadtree meant a node
organization strategy (that's why I said ...or a particular
parent/child layout for OSG nodes? in my second email) and there
isn't any real quadtree support in OSG but it seems that one can
simulate quadtree-like (or octree-like) structures using the
hierarchical bounding box mechanism of OSG's nodes.

The problem was that I expected OSG to be able to do a per-Drawable
culling over the Billboard (and Geode), instead it seems that the
culling is done only per-Node, and since I put all the drawables under
the same billboard Node the culling is of course performed on the
whole block which explains my results and Paul's results. So if I am
not wrong the Billboard node and the Geode node are the smallest
cullable entities, which can be annoying at times since one has to
create a large number of extra nodes to achieve proper culling.

I have also another important doubt though: is the hierarchical
bounding box tree (HBBT) kept up to date frame by frame? I have this
doubt because billboards by definition rotate following the camera and
thus potentially modify the HBBT. If the HBBT is not kept up to date
taking in consideration the billboards rotation the whole frustum
culling mechanism could become inconsistent producing wrong results
(object popping in and out).
Dunno if I was clear enough, if anyone is interested I can send a
simple picture explaining better what I mean.

Thanks very much to every one,
Michele

On Fri, May 23, 2008 at 7:11 PM, Paul Martz [EMAIL PROTECTED] wrote:
 Thanks for the example code. When I bring it up, I get cull ~5ms, and draw
 ~15ms. I then use the middle mouse button to drag all the billboards off the
 screen, and I get cull ~0.1ms, and draw ~0.3ms. So, obviously, frustum
 culling is working.

 However, performance is a cliff that only drops off when all billboards are
 offscreen. This tells me something is wrong in the organization of your
 scene graph. There is already quite a bit of discussion regarding that on
 this thread.

 When the data in your scene graph is spatially organized, you should see
 cull/draw times ramp down as the amount of visible data decreases.
   -Paul

 ___
 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] osg::Viewer remove event handler

2008-04-28 Thread Michele Bosi
Hello,
I need to remove an event handler added to a Viewer using
addEventHandler (osgGA::GUIEventHandler *eventHandler)
I expected to find something like remove/delete/eraseEventHandler
but couldn't find anything, how can I remove then an event handler?

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


Re: [osg-users] osg::Viewer remove event handler

2008-04-28 Thread Michele Bosi
In case anyone is interested here's my implementation of the
removeEventHandler(), it's a simple removal from the std::list used by
OSG, don't know if there are other interactions that one should take
care of though:

  void removeEventHandler(osgGA::GUIEventHandler* eventHandler)
  {
osgViewer::View::EventHandlers::iterator it =
std::find(_eventHandlers.begin(), _eventHandlers.end(), eventHandler);
if ( it != _eventHandlers.end() )
  _eventHandlers.erase( it );
  }


On Mon, Apr 28, 2008 at 2:08 PM, David Callu [EMAIL PROTECTED] wrote:
 Hi Michele


  Other correct me if i am wrong, but I don't found any method to remove
 EventHandler from an osgViewer::View.
  Fell free to implement one :-).

 HTH
 David Callu

  2008/4/28 Michele Bosi [EMAIL PROTECTED]:
 
 
 
  Hello,
  I need to remove an event handler added to a Viewer using
  addEventHandler (osgGA::GUIEventHandler *eventHandler)
  I expected to find something like remove/delete/eraseEventHandler
  but couldn't find anything, how can I remove then an event handler?
 
  Thanks,
  Michele
  ___
  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] antialiased lines

2008-04-24 Thread Michele Bosi
Ciao Gialluca,
you absolutely need to enable GL_LINE_SMOOTH and GL_BLEND and to setup
a blending function like for example osg::BlendFunc(GL_SRC_ALPHA,
GL_ONE_MINUS_SRC_ALPHA). The same goes for GL_POINT_SMOOTH.

Michele

On Thu, Apr 24, 2008 at 12:20 PM, Gianluca Natale
[EMAIL PROTECTED] wrote:




 Hi OSG developers!



 I'm trying to draw antialiased lines with OSG ver .2.2, but I'm having 
 problems.



 This is my code:



osg::ref_ptrosg::Hint antialiasHint = new osg::Hint(GL_LINE_SMOOTH_HINT, 
 GL_NICEST);

StateSet-setAttributeAndModes(antialiasHint.get(), 
 osg::StateAttribute::ON);



 Obviously I've also set a blending function.

 Is there something wrong in my code, or a well-known bug in OSG 2.2?



 Note that in OSG ver. 1.2 I obtained the same effect just by calling:



StateSet-setMode(GL_LINE_SMOOTH, osg::StateAttribute::ON);



 This still does work in OSG ver 2.2, but I wanted to update my code to the 
 correct use of glHint

 under OSG.



 Thank you in advance.

 Gianluca Natale


 ___
 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] Projecting a point given a camera

2008-04-22 Thread Michele Bosi
Thankyou Robert,
the method you suggested works flawlessly :)

On Tue, Apr 22, 2008 at 10:28 AM, Robert Osfield [EMAIL PROTECTED]
wrote:

 Hi Bob,

 Handling multiple cameras has to be done by checking the viewport
 dimensions and selecting a camera, and the associated view from this.
 osgViewer does this itself internally when passing events to different
 views.

 Robert.

 On Mon, Apr 21, 2008 at 9:38 PM, Robert Balfour [EMAIL PROTECTED] wrote:
  I've used this technique, also using an osg:BoundingBox(-1,-1,-1,1,1,1)
   check (before applying the windowmatrix) to see if the point is in
 view.
 
   Which leads me to ask, if you have multiple slave cameras (for ex: 4
   cams, each viewport rendering 25% of the scene left-to-right), how can
   you best determine which camera to use for the projection technique
   below? (i.e. what camera is the point in view?), or do you need to test
   all of them to find it?
 
   Bob.
 
 
   ---
 
 
  Robert Osfield wrote:
   
Hi Michele,
   
All the component parts required are there in osg::Camera and
osg::Matrix and can be mixed and matched depending upon your needs.
   
To go from object coords to window you do:
   
  osg::Matrix MVPW = modelmatrix *
camera-getViewMatrix() *
camera-getProjectionMatrix() *
   
camera-getViewport()-computeWindowMatrix();
   
  osg::Vec window = object * MVPW;
   
Robert.
   
On Mon, Apr 21, 2008 at 5:19 PM, Michele Bosi [EMAIL PROTECTED]
 wrote:
 Hello,
 I need to project the mouse coordinates in world coordinates given
 a
 Camera*, how can I implement this? I expected some
 project/unproject
 method similar to gluProject/Unproject in the Camera class or in
 the Viewer
 or in Matrix but couldn't find anything. Can anyone point me in the
 right
 direction before I start cut-and-pasting the sourcecode from MESA's
 gluProject()? :)

 Thanks,
 Michele

 ___
  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
 
   --
   Robert E. Balfour, Ph.D.
   Exec. V.P.  CTO,  BALFOUR Technologies LLC
   960 South Broadway, Suite 108, Hicksville NY 11801
   Phone: (516)513-0030  Fax: (516)513-0027  email: [EMAIL PROTECTED]
 
 
  ___
   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] Projecting a point given a camera

2008-04-21 Thread Michele Bosi
Hello,
I need to project the mouse coordinates in world coordinates given a
Camera*, how can I implement this? I expected some project/unproject
method similar to gluProject/Unproject in the Camera class or in the Viewer
or in Matrix but couldn't find anything. Can anyone point me in the right
direction before I start cut-and-pasting the sourcecode from MESA's
gluProject()? :)

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


Re: [osg-users] Help! Some error in my scene, but I don't how to fix it.

2008-04-01 Thread Michele Bosi
Sometimes similar errors occur when the depth dest is not active or depth
write mask is false, check that the first one is active and the second one
is set to true

2008/3/31 Wu Xiaodong [EMAIL PROTECTED]:

  The error could be caused by the wrong triangle normals.

 Thanks all the same.

 Xiaodong





 2008/3/31 Robert Osfield [EMAIL PROTECTED]:

 HI Xiaodong Wu
 
  Without more information one can't say what the problem might be.  Is
  it the black triangles that you weren't expecting?  If so then it's
  probably the source data/the data import/ or your model construction
  that is at fault, this type of issue is unlikely to be actual OSG
  problem unless there is a bug in one of the loaders.
 
  Robert.
 
  2008/3/31 Wu Xiaodong [EMAIL PROTECTED]:
  
  
   Hi. I got some error in my scene,  I snap the screen. which is
  attached.
  
   I  load a triangle mesh into my scene, then the error was caused. I
  try to
   disable the culling by the code..-setCullingActive( 0 ); , which
  cannot
   fix the error,
  
   I need help, for i don't know how it was caused, and how to fix it.
  
   Thanks.
  
  
   Xiaodong Wu
  
   ---
   Xiaodong Wu
   吴晓东
   'Xiao' means the time and the view when the sun rises and 'dong'
  means the
   east in Chinese
  
   ___
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
 



 --
 Xiaodong Wu
 吴晓东
 'Xiao' means the time and the view when the sun rises and 'dong' means
 the east in Chinese

 ___
 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] Transparency order

2008-03-17 Thread Michele Bosi
Hello to all,
I have 2 complex intersecting transparent objects A and B: I would
like to draw B always after A but both after opaque objects.

Now I puth both of them under the TRANSPARENT_BIN so that they are
drawn after opaque objects, but how can I tell OSG to draw B always
after A?

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


[osg-users] Trackball manipulator

2008-02-15 Thread Michele Bosi
Hello to all (and welcome back Robert!),
I have 2 questions about the Trackball manipuator

1- In my application I have multiple views each with a model in  it
(and a trackball manipulator) and when I select a view I want all the
other views to stop from rotating if they are. Is there a way to
programmatically stop the Trackball manipulator's automatic rotation?

2- I would like to see two models on the very same view one over the
other even if they are intersecting each other, in order to compare
their shapes. The problem is that I also need to rotate them
independently, which means that I cannot simply manipulate the camera
but I need to really rotate each object independently one at a time.
Can I accomplish this somehow using the TrackballManipulator?

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


Re: [osg-users] Trackball manipulator

2008-02-15 Thread Michele Bosi
Thank you Robert, it was very enlightning :)

Michele

On Fri, Feb 15, 2008 at 2:15 PM, Robert Osfield
[EMAIL PROTECTED] wrote:
 Hi Michele,


  On Fri, Feb 15, 2008 at 11:20 AM, Michele Bosi [EMAIL PROTECTED] wrote:
   Hello to all (and welcome back Robert!),
I have 2 questions about the Trackball manipuator
  
1- In my application I have multiple views each with a model in  it
(and a trackball manipulator) and when I select a view I want all the
other views to stop from rotating if they are. Is there a way to
programmatically stop the Trackball manipulator's automatic rotation?

  There isn't a way right now.  The easiest way to do it would probably
  be to add a virtual method into MatrixManipulator to enable the
  toggling on/off of any animation.  Feel free to add this and send me
  the changes.


2- I would like to see two models on the very same view one over the
other even if they are intersecting each other, in order to compare
their shapes. The problem is that I also need to rotate them
independently, which means that I cannot simply manipulate the camera
but I need to really rotate each object independently one at a time.
Can I accomplish this somehow using the TrackballManipulator?

  You could do this by having two Views that use the same viewport
  settings so they overlap, but turn off the colour buffer clear for the
  second view via view.getCamera()-setClearMask(), you'll also need to
  the Camera's RenderOrder to make sure the one with clear off is drawn
  second.  One could possible attach the same camera manipulator to each
  view and turn of the event handling for one of the views.
  Alternatively on each frame you could just sync the view matrix on the
  second manipulator with the setting from the first view.

  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] polygon index error

2008-01-22 Thread Michele Bosi
Thank you very much Alberto,
I will try to update my Mesa version to the latest to see if that
fixes the problem.

Regards,
Michele

On Jan 22, 2008 9:55 AM, Alberto Luaces [EMAIL PROTECTED] wrote:
 El Monday 21 January 2008 18:12:50 Michele Bosi escribió:

  I have a strange problem with my marching cube algorithm when the mesh
  generated is bigger than 3700 polygons more or less (I am using
  indexed polygons).
  The problem seems to be the Linux MESA driver (Ubuntu 7.04) since
  under WinXP everything works well.
  I also tried to disable the display lists and VBOs to see if the
  driver reacted in anyway but with no result.
 
  Did anyone experienced a similar problem?
  Is there any OSG/OpenGL limit (maybe platform or driver dependent) to
  the polygons one can insert in an osg::DrawElementsUInt?
  Cutting the mesh into 3500 polygon chunks could be a temporary (and
  poor) solution... any other suggestion?
 
  Thanks,
  Michele

 There were some problems belonging to the versions of mesa-glx package that
 Ubuntu 7.04 and 7.10 shipped (I think it is solved on 7.10 now). I had
 crashes on 7.04 while editing meshes in Blender related to and out-of-bounds
 error with VBOs. I read somewhere that new versions of Mesa try to use VBOs
 under the hood in the most situations it can, so maybe this explains why
 activating/deactivating VBOs and display lists doesn't make a difference.
 Here is the bug error I posted time ago:

 https://bugs.launchpad.net/mesa/+bug/109405

 With 7.04, you can either roll back to the 6.5.1 version or try to update the
 package in order to get a fix. You can also compile from source.

 Alberto
 ___
 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] polygon index error

2008-01-22 Thread Michele Bosi
Updating to MESA 7.0.2 actually fixed the problem :)
So it seems that the MESA distributed with Ubuntu 7.04 is actually
bugged (and they didn't provide any update for it except the
possibility to update the whole distribution to 7.10).

Thanks again Alberto,
Michele

On Jan 22, 2008 10:43 AM, Michele Bosi [EMAIL PROTECTED] wrote:
 Thank you very much Alberto,
 I will try to update my Mesa version to the latest to see if that
 fixes the problem.

 Regards,
 Michele


 On Jan 22, 2008 9:55 AM, Alberto Luaces [EMAIL PROTECTED] wrote:
  El Monday 21 January 2008 18:12:50 Michele Bosi escribió:
 
   I have a strange problem with my marching cube algorithm when the mesh
   generated is bigger than 3700 polygons more or less (I am using
   indexed polygons).
   The problem seems to be the Linux MESA driver (Ubuntu 7.04) since
   under WinXP everything works well.
   I also tried to disable the display lists and VBOs to see if the
   driver reacted in anyway but with no result.
  
   Did anyone experienced a similar problem?
   Is there any OSG/OpenGL limit (maybe platform or driver dependent) to
   the polygons one can insert in an osg::DrawElementsUInt?
   Cutting the mesh into 3500 polygon chunks could be a temporary (and
   poor) solution... any other suggestion?
  
   Thanks,
   Michele
 
  There were some problems belonging to the versions of mesa-glx package that
  Ubuntu 7.04 and 7.10 shipped (I think it is solved on 7.10 now). I had
  crashes on 7.04 while editing meshes in Blender related to and out-of-bounds
  error with VBOs. I read somewhere that new versions of Mesa try to use VBOs
  under the hood in the most situations it can, so maybe this explains why
  activating/deactivating VBOs and display lists doesn't make a difference.
  Here is the bug error I posted time ago:
 
  https://bugs.launchpad.net/mesa/+bug/109405
 
  With 7.04, you can either roll back to the 6.5.1 version or try to update 
  the
  package in order to get a fix. You can also compile from source.
 
  Alberto
  ___
  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] osgViewer::OpenGLQuerySupport crash

2008-01-22 Thread Michele Bosi
My program uses osgViewer::StatsHandler, but when I press 'S' the
second time to show the extended statistics it crashes with the
following back-trace.
The strange thing is that if I press 'S' only once the program shows
the FPS without problem, but if I press 'S' again it crashes.
Did anyone experienced the same problem?
Note that the program crashes only on my Ubuntu 7.04+Mesa 7.0.2 box
and not under WinXP.

Regards,
Michele

Backtrace taken with gdb:

#0  0x10c9 in ?? ()
#1  0xb7b38549 in osg::Drawable::Extensions::glGetQueryObjectui64v ()
from /usr/local/lib/libosg.so.25
#2  0xb7cc1012 in osgViewer::OpenGLQuerySupport::checkQuery () from
/usr/local/lib/libosgViewer.so.25
#3  0xb7cc3083 in osgViewer::Renderer::cull_draw () from
/usr/local/lib/libosgViewer.so.25
#4  0xb7cc3723 in osgViewer::Renderer::operator() () from
/usr/local/lib/libosgViewer.so.25
#5  0xb7b7ca88 in osg::GraphicsContext::runOperations () from
/usr/local/lib/libosg.so.25
#6  0xb7cf5bd6 in osgViewer::ViewerBase::renderingTraversals () from
/usr/local/lib/libosgViewer.so.25
#7  0xb7cf4e23 in osgViewer::ViewerBase::frame () from
/usr/local/lib/libosgViewer.so.25
#8  0x080610b2 in OsgQtViewer::paintGL (this=0x8107000) at
../../include/osgolem/osgqtviewer.hpp:149
#9  0x0805c06e in EditorWidget::paintGL (this=0x8107000) at editorwidget.cpp:364
#10 0xb7a377ab in QGLWidget::glDraw () from /usr/lib/libQtOpenGL.so.4
#11 0xb7a3628f in QGLWidget::updateGL () from /usr/lib/libQtOpenGL.so.4
#12 0xb7a55e92 in QGLWidget::qt_metacall () from /usr/lib/libQtOpenGL.so.4
#13 0x08077754 in EditorWidget::qt_metacall (this=0x8107000,
_c=QMetaObject::InvokeMetaMethod, _id=27, _a=0xbfa304f4) at
moc_editorwidget.cpp:90
#14 0xb728 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#15 0xb72ab42a in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#16 0xb72ca2b7 in QTimer::timeout () from /usr/lib/libQtCore.so.4
#17 0xb72b267e in QTimer::timerEvent () from /usr/lib/libQtCore.so.4
#18 0xb72a9834 in QObject::event () from /usr/lib/libQtCore.so.4
#19 0xb7440190 in QApplicationPrivate::notify_helper () from
/usr/lib/libQtGui.so.4
#20 0xb74428c1 in QApplication::notify () from /usr/lib/libQtGui.so.4
#21 0xb72bda43 in ?? () from /usr/lib/libQtCore.so.4
#22 0xb691fdf2 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#23 0xb6922dcf in ?? () from /usr/lib/libglib-2.0.so.0
#24 0x080e5490 in ?? ()
#25 0x in ?? ()
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] polygon index error

2008-01-21 Thread Michele Bosi
I have a strange problem with my marching cube algorithm when the mesh
generated is bigger than 3700 polygons more or less (I am using
indexed polygons).
The problem seems to be the Linux MESA driver (Ubuntu 7.04) since
under WinXP everything works well.
I also tried to disable the display lists and VBOs to see if the
driver reacted in anyway but with no result.

Did anyone experienced a similar problem?
Is there any OSG/OpenGL limit (maybe platform or driver dependent) to
the polygons one can insert in an osg::DrawElementsUInt?
Cutting the mesh into 3500 polygon chunks could be a temporary (and
poor) solution... any other suggestion?

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


[osg-users] Font silently not loaded

2008-01-07 Thread Michele Bosi
Hello,
I am trying to load a ttf font file (under win xp) using the following:

osgText::Font* font = osgText::readFontFile(verdana.ttf);

but all I get is a NULL pointer. This file is present in the windows
fonts directory and also in the executable directory.
I also get no result using the function:

text-setFont(font); // 'text' is a osgText::Text

Are TTF files not supported by OSG? or should I enable something
somewhere? From the stdout I don't get any message regarding any font
related error.

As a side note I would like to add that I compiled the plugin
mingw_osgdb_freetype.dll using Freetype 2.3.5.

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


[osg-users] Fonts again: ugly default font

2008-01-07 Thread Michele Bosi
As you might have guessed m lately very much involved in font
rendering with OSG...
As you can se from the small image attached I get quite ugly font
rendering using the default font.
The font you see drawn comes from a very simple piece of code, that is:

  osgText::Text* text = new osgText::Text;
  text-setText(Ciao);
  text-setAlignment(osgText::Text::CENTER_BASE_LINE);
  text-setColor(osg::Vec4(1,1,1,1));
  text-setCharacterSize( 20 );
  text-setPosition( ... );
  text-setAutoRotateToScreen(true);
  text-setCharacterSizeMode(osgText::Text::SCREEN_COORDS);

Is there something wrong with the code I produced or are there hidden
options to make the text look nicer?

Playing around with the texture font it looks like the text is
rendered using texture mapping but without bilinear filtering, that
is, font rendering seems to use nearest point sampled texture mapped
quads, but it's just a guess.

Thanks,
Michele
attachment: ugly-fonts.PNG___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Fonts again: ugly default font

2008-01-07 Thread Michele Bosi
Thank you Robert and Jean,
fortunately could figure out what the problem was using the god
blessed OSG_NOTIFY_LEVEL=DEBUG :)

In fact it seemed that the plugin could be found and used but then OSG
failed to load it. This was because of course the plugin depends on
the freetype DLL library itself which wasn't in the path so I just had
to add it to the path and woila', fonts are loading and text is
beautiful :)

Thanks again,
M.

On Jan 7, 2008 3:34 PM, Jean-Sébastien Guay
[EMAIL PROTECTED] wrote:
 Hello Michele,

  As you might have guessed m lately very much involved in font
  rendering with OSG...
  As you can se from the small image attached I get quite ugly font
  rendering using the default font.
  The font you see drawn comes from a very simple piece of code, that is:

 If you set OSG_NOTIFY_LEVEL=DEBUG, do you get messages saying that the
 font Arial.ttf could not be loaded? The default font that
 osgText::Text uses should be Arial. If you have the
 OpenSceneGraph-Data distribution, it's in the fonts/ subdirectory, and
 setting OSG_FILE_PATH to the location of the OpenSceneGraph-Data
 distribution on your machine, it should find it.

 If you get an error message that the font cannot be found, check that
 (with the paths). If it's that the file cannot be loaded, it can be
 because your freetype plugin is not compiled properly or something
 else...

 Good luck,

 J-S
 --
 __
 Jean-Sebastien Guay [EMAIL PROTECTED]
  http://whitestar02.webhop.org/

 
 This message was sent using IMP, the Internet Messaging Program.



 ___
 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] Text rendering

2008-01-04 Thread Michele Bosi
Hello,
in my programs I would like to show some text following the objects
that are in the scene.
Till now the solution that I found was to create an osgText::Text
object and do something like:

  text-setPosition( world space position );
  text-setAutoRotateToScreen(true);

the problem is that the text is draw very big, and is affected by
perspective projection which in this case I wouldn't like.
Basicly I need a text that behaves like if it was drawn on a HUD but
whose position on the screen is based on the objects they are
following
(that is, is the projection on the screen of some world space
coordinates). How can I accomplish this?
The only solution I have in mind is to put all the text objects on a
HUD (which complicates a lot the design of my program) and to compute
by hand, every frame, the projection of the objects they are
following, so that i can assign it to the text objects.
Isn't there a built in functionality to achieve the same result?

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


[osg-users] osgText::Text background color

2008-01-04 Thread Michele Bosi
Hello,
in my application I am using some osgText::Text objects to render some
short text, but unfortunately is not so easy to read.
I tried to put an outline and drop shadows using the function
setBackdropType() but with very poor results.
I was wondering if there was a way to make OSG draw the background of
the text with a given color/transparency and eventually if
one could visualize a frame around the text. I think I saw it done
somewhere but cannot recall where...

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


Re: [osg-users] Text rendering

2008-01-04 Thread Michele Bosi
Thank you Chase this is exactly what i needed :)
I have another question to ask but for that I will start another
thread for clarity.

Michele

On Jan 4, 2008 5:31 PM, Bradford, Chase [EMAIL PROTECTED] wrote:

 You might be able to accomplish what you want by setting 
 text-setCharacterSizeMode( osgText::Text::SCREEN_COORDS ).  That applies a 
 scale that warps the text into pixel coordinates, instead of object 
 coordinates.

 Chase



 -Original Message-
 From: [EMAIL PROTECTED] on behalf of Michele Bosi
 Sent: Fri 1/4/2008 8:25 AM
 To: OpenSceneGraph Users
 Subject: [osg-users] Text rendering

 Hello,
 in my programs I would like to show some text following the objects
 that are in the scene.
 Till now the solution that I found was to create an osgText::Text
 object and do something like:

   text-setPosition( world space position );
   text-setAutoRotateToScreen(true);

 the problem is that the text is draw very big, and is affected by
 perspective projection which in this case I wouldn't like.
 Basicly I need a text that behaves like if it was drawn on a HUD but
 whose position on the screen is based on the objects they are
 following
 (that is, is the projection on the screen of some world space
 coordinates). How can I accomplish this?
 The only solution I have in mind is to put all the text objects on a
 HUD (which complicates a lot the design of my program) and to compute
 by hand, every frame, the projection of the objects they are
 following, so that i can assign it to the text objects.
 Isn't there a built in functionality to achieve the same result?

 Thanks,
 Michele
 ___
 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] CPU friendly trackball manipulator

2008-01-02 Thread Michele Bosi
Hello,
I have a static scene that my program visualizes using a trackball
manipulator. I would like to update the rendering only when the camera
moves, that is the user moves it with the mouse or the camera is
spinning around. I am using a Qt wrapper so I know how to stop the
refresh by simply stopping the QTimer in there, and I also know how to
update upon user interaction since Qt gives very nice messages, what I
don't know is: how can I know if the trackball manipulator is making
my camera spinning around or not?
Maybe osgGA::TrackballManipulator::getRotation() encodes in some way
the rotation velocity? or it's just the current rotation of the
camera?

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


[osg-users] osgFX::Cartoon makes gray

2007-12-17 Thread Michele Bosi
Hello,
I am using osgFX::Cartoon node to optionally draw some molecules using
cel-shading,
the problem is that osgFX::Cartoon makes everything look gray and the
color of the
objects seems to be lost, is that intentional or am I missing something?

All I do is to set the osgFX::Cartoon as the root node of the scene
and then all the
other nodes are made child of it.

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


Re: [osg-users] osgFX::Cartoon makes gray

2007-12-17 Thread Michele Bosi
I setup a texture to the shader node but it doesn't seem to solve the
probem, here's how I setup my shader:

  mOsgRoot = new osg::Group;
  osgFX::Cartoon* toon = new osgFX::Cartoon;
  viewer- setSceneData(mOsgRoot);
  mOsgRoot-addChild(toon);
  toon-addChild(mEditor-osgGroup().get()); // this is the scene
graph with various objects

  // apply the texture

  osg::ref_ptrosg::Texture2D texture =
TextureManager::get()-loadTexture( cartoon.tga ); // half
translucent red textue
  toon-getOrCreateStateSet()-setTextureAttributeAndModes( 0,
texture.get(), osg::StateAttribute::ON ||
osg::StateAttribute::OVERRIDE );

  I tried with different textures, black, gray, white, with and
without alpha channel without luck.
  Is there a specified needed size for such a texture? do I need only
the color information or also the alpha?

  I also attached a file showing the gray molecule.

Thanks,
Michele
attachment: mol.PNG___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgFX::Cartoon makes gray

2007-12-17 Thread Michele Bosi
Thank you for your suggestion I tried it but, again, no luck.
Di you manage to have coloured cartoon-shaded objects? If so, what
kind of texture did you use?

Thanks,
Mic

On Dec 17, 2007 1:02 PM, Ralph Kern [EMAIL PROTECTED] wrote:
 I guess you have to use a osg::Texture1D instead of osg:Texture2D

 regards Ralph

 Michele Bosi schrieb:

  I setup a texture to the shader node but it doesn't seem to solve the
  probem, here's how I setup my shader:
 
mOsgRoot = new osg::Group;
osgFX::Cartoon* toon = new osgFX::Cartoon;
viewer- setSceneData(mOsgRoot);
mOsgRoot-addChild(toon);
toon-addChild(mEditor-osgGroup().get()); // this is the scene
  graph with various objects
 
// apply the texture
 
osg::ref_ptrosg::Texture2D texture =
  TextureManager::get()-loadTexture( cartoon.tga ); // half
  translucent red textue
toon-getOrCreateStateSet()-setTextureAttributeAndModes( 0,
  texture.get(), osg::StateAttribute::ON ||
  osg::StateAttribute::OVERRIDE );
 
I tried with different textures, black, gray, white, with and
  without alpha channel without luck.
Is there a specified needed size for such a texture? do I need only
  the color information or also the alpha?
 
I also attached a file showing the gray molecule.
 
  Thanks,
  Michele
 
 
  

 

 ___
 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] osgFX::Cartoon makes gray

2007-12-17 Thread Michele Bosi
Thank you Robert,
that is exactly the problem, it seems from the source code that the
shader doesn't support GL_COLOR_MATERIAL enabled, in order to do so I
think one should write another shader that reads the current color and
not the current material.diffuse component.
Also it seems that the effect doesn't show up specular highlights, do
you see any specular highlights in your models?

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


Re: [osg-users] osgFX::Cartoon makes gray

2007-12-17 Thread Michele Bosi
Thank you very much Robert,
for now I will try to modify the shader in a
subclass/cut-and-paste-class of osgFX::Cartoon so that it can handle
color-material and cartoon-like speculars, if I manage to have
something working I will post it back here (crossing fingers).

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


Re: [osg-users] retrieving SceneView and contextID()

2007-12-14 Thread Michele Bosi
Thank you very much to everyone for the replies,
now the situation is much clearer and I think I can solve my problem
which by the way is (should be) very easy, that is I need
the context id simply to pass it to some function that check the
support for extensions like point sprite. I am going to have
multiple opengl windows but on simple systems, with one card, one
monitor, so checking for the supported extensions in one context
should be valid for all the others.

Thank you again,
Michele

On Dec 14, 2007 11:14 AM, Robert Osfield [EMAIL PROTECTED] wrote:
 HI Michale,

 The ContextID is associated with GraphicsContext's, and its the
 Viewer's Camera's that hold the GraphicsContext (normally a
 GraphicsWindowsX11/Win32/Carbon subclass), and each GraphicsContext
 has the State object, each of which has the ContextID so on can do:

   viewer.getCamera()-getGraphicsContext()-getState()-getContextID();

 Or if the viewer's master Camera doesn't have a GraphicsContext,
 instead it delegates the rendering to its slaves then you'll need to
 iterator through the slave Camera's to get the ContextID.  There is a
 viewer.getContexts(osgViewer::ViewerBase::Contexts) convinience
 method to help you get the lists of all the active graphics contexts,
 so you could easily use this instead of iterating through.

 And... not once did you need to grapple with the internal
 implementation of SceneView that is used the hood.  But if you really
 really must grapple then the Camera::getRenderer() will give you the
 Renderer that is used to do the rendering - and its this
 osgViewer::Renderer that has the SceneView that does all the internal
 work.

 Robert.


 On Dec 13, 2007 9:52 PM, Michele Bosi [EMAIL PROTECTED] wrote:
  Hello,
  I need to retrieve the current contextID or the contextID that a
  Viewer is working on, how do I do it?
  I saw in the documentation that one should retrieve the SceneView but
  it doesn't say how / from where, and I couldn't
  figure it out, as far a I could see osg::View and its subclasses
  doesn't have such a getSceneView() method
  or similar. I saw that there were some posts about how to retrieve the
  context from a camera but that seemed
  to be more of an hack than the actual standard way so if possible I
  would like to avoid that solution.
  So, what is the clean and mean way of retrieving the SceneView given
  an osgViewer::Viewer?
 
  Regards,
  Michele

  ___
  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] retrieving SceneView and contextID()

2007-12-13 Thread Michele Bosi
Hello,
I need to retrieve the current contextID or the contextID that a
Viewer is working on, how do I do it?
I saw in the documentation that one should retrieve the SceneView but
it doesn't say how / from where, and I couldn't
figure it out, as far a I could see osg::View and its subclasses
doesn't have such a getSceneView() method
or similar. I saw that there were some posts about how to retrieve the
context from a camera but that seemed
to be more of an hack than the actual standard way so if possible I
would like to avoid that solution.
So, what is the clean and mean way of retrieving the SceneView given
an osgViewer::Viewer?

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


Re: [osg-users] Raytracing status

2007-12-12 Thread Michele Bosi
I am totally not a ray tracing guru, but I would like to have a look
at the code of Adrian to have an idea, where can I find it? Is there
any demo or usable working test of it?

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


Re: [osg-users] Raytracing status

2007-12-12 Thread Michele Bosi
Thank you Jean, Adrian was kind enough to send me already its code, I
am reviewing it now :)
Hope to hear from you as soon as possible about OSG realtime ray tracing though!

I was thinking, maybe it wouldn't be a bad idea to integrate YafRay
into OSG, the license (LGPL) seems ok with it, unlike POV-Ray. If not
a real integration maybe an utility class would be already
interesting: this class would parse the OSG nodes, convert them into
YafRay data and output the rendered image. Dunno this is just a raw
idea that I put here so if some YafRay guru is between us we can be
all enlighted :)

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


[osg-users] Extension checking

2007-12-11 Thread Michele Bosi
Is there a way using OSG to know if a given extension is supported.
Using libraries like GLEW isn't going to create linking conflicts or
problems to OSG?

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


[osg-users] Raytracing status

2007-12-11 Thread Michele Bosi
Hello all,
after some info about OpenGL 3 the most interesting topic I am eager
to hear about is the ray-tracing support in OSG! Are there any news?
If there is something I am gonna ask to Santa this Chirstmas is a new
OSG raytracer for sure... I already dropped the OpenGL 3
specifications option...
For folks like me it would already be VERY interesting to have
something that can ray-trace triangles, spheres, cylinders, make some
transparency, simple sharp shadows and specular hightlights, probably
that's all I need to raytrace some very nice molecules :)
So, what are the news? Is there any chance to raytrace a couple of
thousands of spheres at (barely) interactive frame rates?

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


[osg-users] Documentation Building Problem

2007-12-06 Thread Michele Bosi
Hello to all,
I was trying to build the documentation for OSG 2.2 under WinXP using
CMake but apparently there is a problem, when I configure the
makefiles CMake complains that there isn't the file
[...]/doc/Doxyfiles/doxyfile.cmake, which in fact does not exist. Is
that a bug or a feature? How can I build the documentation?
Just wanted to add that I already built and use daily the library
itself without the documentation and everything went smooth till now.

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


Re: [osg-users] osgOQ occlusion query release candidate available

2007-11-30 Thread Michele Bosi
Works for me too flawlessly :)

ATI X700M 128Mb, AMD Sempron 3000+, 1GB RAM, resolution = 1280x800
Compiled with MinGW under WinXP SP2

occluded = 115 fps

not occluded = 660 fps

The stats reported have been measured using Fraps.

Excellent work!

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


Re: [osg-users] osgOQ occlusion query release candidate available

2007-11-30 Thread Michele Bosi
On Nov 30, 2007 5:36 PM, Paul Martz [EMAIL PROTECTED] wrote:

  Just a (bunch of) question: how this nodekit works? do you
  give a defined set of occluders to test the node to be
  occluded against? or you try to delay the rendering of the
  potentially occluded node as much as possible and test for
  occlusion against what has been already rendered? or are you
  using other (possibly mixed) strategies? That sounds to me
  quite an interesting problematic to solve, isn't it?

 In the docs/readme.txt there is an overview of how you can use osgOQ in your
 app, plus an overview of the algorithm.

 The basic idea is you insert an OcclusionQuery Node into your scene graph,
 and it performs occlusion testing to determine whether or not to draw its
 children. You don't need to specify occluders; occluders are anything that
 is visible.

 The basic algorithm:

 1. During the draw traversal, perform an occlusion query using the bounding
 geometry of the attached children. This query uses the RenderBin number to
 issue the query after all opaque geometry has been rendered (to maximize
 chances for occlusion).

 2. In a Camera post-draw callback, retrieve the results for any/all queries
 that were issued.

 3. In the next frame's cull traversal, use the previous frame's query
 results to determine whether to draw the children of the OcclusionQueryNode.

 This approach has a couple advantages:
  * It minimizes pipe stalls by not retrieving queries until finished
 drawing.
  * It allows osgOQ to perform queries for entire subgraphs.
  * It requires no modifications to core OSG.

 It also has disadvantages:
  * When complex geometry becomes visible, there is a slight delay before it
 appears due to the dependency on the previous frame's results.
  * Have to wait until all queries are retrieved before swapping buffers.

 I considered a few other approaches:

  * In order to eliminate the 1-frame latency, I'd have to issue a query,
 retrieve it, and then decide whether to draw or not. Not only would this
 stall the pipe, but it would prevent osgOQ from being able to perform
 occlusion tests on entire subtrees -- the queries could only be per-Drawable
 in such a scenario.

  * I considered adding a post-swap callback or traversal to retrieve the
 queries. This would allow OSG to issue the swap and then retrieve the
 results in the post-swap callback (presumably while the GPU is idle in
 vertical retrace). I might still do this in the future. But for the sub-20Hz
 test cases I've been working with, this wasn't really critical.

 I hope that makes sense.

Yeah, given the complex nature of the problem it seems to me a very
good and general solution. The one frame latency shouldn't hurt too
much anyone, and if it does, it means that the frame rate is already
very low and the scene is moving too fast compared to the frame rate,
which means that the user is anyway annoyed by the lack of
interactivity, or that objects are moving so fast that you can hardly
see them, but at decent frame rates let's say already above 20 or so
the one-frame-latency should hardly be noticeable.

Thank you for sharing this info,
bye,
Michele

 Paul Martz
 Skew Matrix Software LLC
 http://www.skew-matrix.com
 303 859 9466


 ___
 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] globally disable display lists / VBOs

2007-11-27 Thread Michele Bosi
Hello,
I was wondering if there was a way to globally disable the use of
display lists and VBO (just for performance profiling purposes).

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


[osg-users] Single point geometry not drawn

2007-11-27 Thread Michele Bosi
Hello, I have an interesting problem here: when I try to draw a
Geometry containing a single point it doesn't get drawn, if the
geometry has two points distant enough they will get shown, it looks
like if there is some kind of detail culling which things that a
single point or two close points shouldn't be drawn. My system is a
simple Ubuntu 7 and Mesa OpenGL (no hardware drivers used).

Here's the code:

// this geometry represents a single atom, that's why it's a point
osg::ref_ptrosg::Geometry pointGeom = new osg::Geometry();

osg::ref_ptrosg::Vec3Array pointVert = new osg::Vec3Array();
osg::Vec3 v = toOSG(atomData()-position());
pointVert-push_back( v );
pointVert-push_back( v + osg::Vec3f(0,0,0.1) ); //
-- if i put osg::Vec3f(0,0,0.2) or more the geometry
is drawn otherwise is not drawn
pointGeom-setVertexArray(pointVert.get());

osg::ref_ptrosg::Vec4Array colors = new osg::Vec4Array;
colors-push_back( toOSG( color() ) );
pointGeom-setColorArray(colors.get());
pointGeom-setColorBinding(osg::Geometry::BIND_OVERALL);

pointGeom-addPrimitiveSet( new
osg::DrawArrays(osg::PrimitiveSet::POINTS, 0, pointVert-size()) );

// geode
osg::Geode* geode = new osg::Geode;
osgGroup()-addChild(geode);

// states
geode-getOrCreateStateSet()-setMode(GL_LIGHTING,
osg::StateAttribute::OFF);

osg::ref_ptrosg::Point point = new osg::Point;
point-setSize( pointSize() );
geode-getOrCreateStateSet()-setAttribute(point.get(),
osg::StateAttribute::ON);


am I missing something very obvious here? it's a bug or something else?

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


Re: [osg-users] globally disable display lists / VBOs

2007-11-27 Thread Michele Bosi
Thanks Paul,
yes in the end the visitor solution seems quite reasonable.

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


Re: [osg-users] Single point geometry not drawn

2007-11-27 Thread Michele Bosi
Thankyou Paul and Robert, that was exactly the problem, for now I
simply disabled the small-feature-culling using setCullingMode, wow I
would have never solved by my self! :)

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


Re: [osg-users] Backface culling for a group containing a plane of linestrips.

2007-10-26 Thread Michele Bosi
Hi Chris,
I did something similar once, I am not totally sure but I think that the
vector should be multiplied before the matrix and that you need to multiply
only the direction component without the position. Once you have the
direction transformed in camera space to see if it faces the camera you
should only need to test if the Z component is  0 (assuming a right handed
reference system).

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


Re: [osg-users] picking/selecting invisible objects

2007-10-15 Thread Michele Bosi
Ciao Alessandro,
I did something very similar to what you are saying activating
backface culling for both front and back faces this way the overhead
on the graphic card should be minimal, even less than activating the
alpha blending to zero:

osg::CullFace* cull= new osg::CullFace(osg::CullFace::FRONT_AND_BACK);

osg::Group* group = new osg::Group;

group -getOrCreateStateSet()-setAttribute(cull,
osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE);

group -getOrCreateStateSet()-setMode( GL_CULL_FACE,
osg::StateAttribute::OVERRIDE | osg::StateAttribute::ON );

This works fine for me using the standard
osgViewer::Viewer::computeIntersections(...)

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


Re: [osg-users] Did anyone compile osg 2.2 with MINGW?

2007-10-15 Thread Michele Bosi
Just to add my 2 cents: apparently I didn't have any problems to
compile the txp plugin with osg 2.2 under mingw (Current). I am using
the DOS shell to compile it and not MSYS (even though it would be nice
but cmake is unable to generate makefiles for msys, or I didn't
configure something properly... who can say...)

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


Re: [osg-users] Did anyone compile osg 2.2 with MINGW?

2007-10-10 Thread Michele Bosi
Just to inform the few ones interested in building OSG with MinGW:
the problem seems to arise when BUILD_OSG_WRAPPERS is set to ON in
both 2.0 and 2.2 version. So if anyone gets this error the thing that
you have to do is to switch off that variable.
It seems that MinGW (Current and Candidate) are unable to build the
introspection modules in both OSG 2.0 and 2.2 because it doesn't
support the wide character part of the Standard C++ Library (see
http://www.mingw.org/MinGWiki/index.php/wide%20characters).
A suggested solution is to use STLPort instead of libstdc++.

Good luck MinGW users!
Michele
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Call for feedback : glu.h does it contain _GLUfuncptr?

2007-10-01 Thread Michele Bosi
MESA 7.1:

/* Internal convenience typedefs */
typedef void (GLAPIENTRYP _GLUfuncptr)();
...
GLAPI void GLAPIENTRY gluNurbsCallback (GLUnurbs* nurb, GLenum which,
_GLUfuncptr CallBackFunc);

MinGW w32api-3.10:

typedef void (APIENTRY *_GLUfuncptr)();
...
GLAPI void APIENTRY gluNurbsCallback (GLUnurbs* nurb, GLenum which,
_GLUfuncptr CallBackFunc);

in MinGW gl.h (not glu.h) there is an interesting note:

 * 2002-Apr-15, Marcus Geelnard:
 *   Modified this file to better fit a wider range of compilers, removed
 *   Mesa specific stuff, and removed extension definitions (this file now
 *   relies on GL/glext.h). Hopefully this file should now function as a
 *   generic OpenGL gl.h include file for most compilers and environments.
 *   Changed GLAPIENTRY to APIENTRY (to be consistent with GL/glext.h).

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


[osg-users] osgUtil::PolytopeIntersector finding the closest intersection

2007-10-01 Thread Michele Bosi
Hi all,
my program needs to select some lines, since
osgViewer-computeIntersections is unable to pick lines I switched to
osgUtil::PolytopeIntersector which is able to do so. Unfortunately
PolytopeIntersector seems unable to tell me the intersection
points/lines from which I would determine the closest object that I
actually picked (among all the other that intersect the picking
volume). Am I missing something? hope so.

To sum up, is there a way to determine the closest object picked by a
osgUtil::PolytopeIntersector (actually not the closest object but the
one which has the closest intersection)? Or, are there other ways to
pick a line object?

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


Re: [osg-users] Polygon sorting

2007-09-06 Thread Michele Bosi
Thanks guys,
I am still trying to find a way to sort real polygons since
performance in my case are not the main concern. Theoretically it
shouldn't be difficult at all (to do it for one single geometry) I
just need an hook that tells me hey your geometry is going to be
drawn using this matrices/camera. I am not sure if node callbacks can
be used for this, then I would create a special Geode that sorts the
polygons of its Geometry objects. From Geode I can retrieve the local
to world transform, then to get the view transform I have to track the
camera object somehow.

If this doesn't work I will try subdividing the mesh in small blocks
each going in a different geometry so that OSG can sort them. The
result won't be spectacular but better than nothing.

Joachim:
My isosurface represent chemical energy fields so they can be quite
messy. Unfortunately I have to rely on conservative OpenGL features
for compatibility issues otherwise that would be the preferred way to
go also for the quality of the results.

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


[osg-users] Polygon sorting

2007-09-05 Thread Michele Bosi
Hello,
I need to sort the polygons of my meshes in order to obtain decent
transparencies for complex autointerstecting objects like 3d
isosurfaces.
I figured out that a very raw way to do so would be to subclass
Viewer, reimplement frame(), and from there getting the viewMatrix and
sorting my poligons based on their distance from the viewer (having
disabled display list support for the node). The actual sorting would
be done on the list of indices (osg::DrawElementsUInt) since I use
indexed triangles.

Since to get correct results I also have to take into account the
transformation applied to my Geometry I was wondering if there was a
more clever way to do all this mess, maybe there are already
mechanisms that inform my Geometry that is going to be drawn so that I
can react sorting my polygons appropriately at the correct moment and
accounting for the currently active transformations, something similar
to the VTK/pipeline system.
Any idea?
Regards,
Mike
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Particle Sorting

2007-09-05 Thread Michele Bosi
Hi,
I am also dealing with transparencies and sorting, in your case maybe
it's enough to mask off z-buffer writing for all the particle systems
using something like:

  osg::Depth* depth = new osg::Depth();
  depth-setWriteMask(false);

  your_geode-getOrCreateStateSet()-setAttribute(depth,
osg::StateAttribute::OVERRIDE | osg::StateAttribute::ON);

also be sure that all the rest is ok, like

your_geode-getOrCreateStateSet()-setRenderingHint(osg::StateSet::TRANSPARENT_BIN);

usually for particle systems using this little trick you don't need to
sort at all.
The method has some flaws since the result is not really correct as if
you sorted your particles but since they are moving this shouldn't be
a problem.

Theoretically transparent object that don't write on the z-buffer
should be rendered after the transparent ones that do write on it so
in order to obtain more correct results for your particles you should
create another BIN  (I know you can do it but have no idea how) and
schedule it after TRANSPARENT_BIN.

I just posted a question about polygon sorting, have you ever
implement it with osg or do you have any particular advice share?

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


[osg-users] Normal Computation and Double Vertex Removal

2007-08-31 Thread Michele Bosi
Hello,
I was wondering if a function/class exists that computes the normals
of an osg::Geometry given its VertexArray and PrimitiveSet. I just
implemented such a function (very small) but thought that mayb there
was a more offical way to do that.

Also I was wondering if there is a class/function that removes double
vertices from an osg::Geometry since I am working on data extracted
with marching cube which generates a lot of doubled vertices.

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


Re: [osg-users] MolecularInventor-like for OSG

2007-08-29 Thread Michele Bosi
Thanks Mario,
hope to hear from you soon :)
Meanwhile I will continue to look around.
-Mike
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Qt include dir problem

2007-08-28 Thread Michele Bosi
Hello,
I am trying to compile OSG 2.0 with the Qt example under Linux Ubuntu 7 + Qt
4.2. The compilation goes well until it reaches osgviewerQT.cpp. The
problem seems to be the fact that cmake doesn't detect the correct QT 4
include directory during the configuration. If I assign (from ccmake) to
QT_INCLUDE_DIR the value /usr/local/Trolltech/Qt-4.2.2/ after the
configuration (c key) the same variable gets updated to
QT_INCLUDE_DIR-NOTFOUND. Is interesting the fact that all the other
QT-related variable are automatically set to the right values (QT_*_DIR =
/usr/local/Trolltech/Qt-4.2.2/*).
Does anyone have any clues?
Thanks,
Mike
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Flipping the normals

2007-08-28 Thread Michele Bosi
Hello,
I've a relatively easy task to accomplish, that is to render a mesh both
from inside and outside.
To do this i put the mesh under two different Geodes, in one i set the front
face to clock wise on the other I set the front face to counter clock
wise turning on the backface culling (or putting the object into a single
Geode turning off the backface culling). The problem is that in one case
(when I render the interior of the mesh) the polygons are not lit since
the normals are (of course) not flipped, that is they remain oriented
outward.
My question is: how can I flip the normals? should I create two distinct
meshes, one with the original normals and the other with inverted normals
(modifying manually the normal buffers, and doubling the memory usage) or
there is a more elegant way to do that, for example a node/state like
GL_PLEASE_FLIP_MY_NORMALS that can take care of this task automatically?
Cheers,
Mike
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Flipping the normals

2007-08-28 Thread Michele Bosi
Thanks very much guys, osg::LightModel/GL_LIGHT_MODEL_TWO_SIDE seems
exactly what I needed.
Thankyou,
Mike
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Flipping the normals

2007-08-28 Thread Michele Bosi
Thanks Paul,
just wanted o add that I am very glad that when it comes to render
states OSG remains so close to OpenGL and doesn't abstract too much
from it, as this case proves, this lets users to reuse their prior
knowledge of OpenGL and makes the library really flexible,
long life to OSG! :)
Mike
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] transparency issue

2007-08-23 Thread Michele Bosi
Hello to everyone,
I am currently working with OSG on a scientific visualization program, I
need to display some transparent concave shapes (some isosurfaces),
unfortunately I could achieve only partially correct results since I can
sort transparent objects but they still appear as if they were teared.
Apparently OSG is able to sort transparent whole objects based on their
distance from the camera but cannot sort their polygons. A possible solution
would be to create a drawable for each polygon and let OSG sort the polygons
as if they were objects but probably that's going to be a very slow (and
ugly) procedure. Another alternative would be to manually sort the
polygons of my mesh before every frame which sounds very similar to an hack.

The same problem can be seen also by simply visualizing a transparent sphere
(disabling back face culling): from some points of view the sphere appears
as if it was teared with a sharp saw-tooth-kind pattern, enabling backface
culling the problem apparently disappears (since is a convex shape).

Isn't there an efficient out of the box feature/node in OSG that sorts the
polygon of one or more objects based on their distance from the camera?
Cheers,
Mike
attachment: osg.png___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org