Re: [osg-users] Modify Object After Picking

2008-02-19 Thread Paul Martz
  I have done this before, and the results are interesting 
 but not high 
  quality due to differences in line/polygon rasterization. 
 Still a good 
  trick nonetheless.
 -Paul
 
 
 glPolygonOffset()?

Yes. This is actually what I used to do (not exactly as the original poster
described it):

1. Render front faces in GL_FILL mode.
2. Disable lighting and texture mapping, and set primary color to white.
3. Enable polygon offset for lines, set to something like (-1, -1) to pull
the wireframe towards the viewer in depth buffer window space.
3. Render backfaces in GL_LINE mode.

With this approach, there is no need to tinker with depth test. The results
were good but somewhat rough. I was using this back in the OpenGL 1.1 days,
so there was no multisampling available, which (I imagine) might improve the
appearance somewhat.

I believe there are ways to get silhouette outline effects these days using
shaders, which don't require multipass and produce better results.

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


Re: [osg-users] Modify Object After Picking

2008-02-19 Thread Mike Weiblen


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:osg-users-
 [EMAIL PROTECTED] On Behalf Of Paul Martz
 Sent: Friday, February 15, 2008 8:20 AM
 To: 'OpenSceneGraph Users'
 Subject: Re: [osg-users] Modify Object After Picking
 
  An extension to this, which I've read about but never
  implemented is, after rendering your object, set ztest to
  equal, switch to wireframe, set line thickness to 2 or 3
  pixels, and render the backfaces of your object. You'll get a
  rather funky, and fairly cheap, silhouette of your object.
  AFAIK, this is how Modo does it's highlighting.
 
 I have done this before, and the results are interesting but not high
 quality due to differences in line/polygon rasterization. Still a good
 trick
 nonetheless.
-Paul


glPolygonOffset()?

-- mew

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


Re: [osg-users] Modify Object After Picking

2008-02-15 Thread Gordon Tomlinson
You will have to write code to do this
 
One way I have done this in thee past is to (once you have the node) ,
calculate the picked nodes bounding box, create a simple wire frame box
1x1x1 add under a transformation node then scale that node to min and max of
the bounding box you calculated and then add the transformation node to the
node you selected. It works, then you can simply remove the transformation
node when your done, 
 
Another old school Performer way, would be to double draw your node once in
normal mode and then a second time in wire frame mode
 
 
 

  _  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Romain
Blanchais
Sent: Friday, February 15, 2008 8:28 AM
To: OpenSceneGraph Users
Subject: [osg-users] Modify Object After Picking


Hello, 

I would like to know if there is a simple way to show if an object is
selected ?

When I load a mesh from a osg file I use readNodeFile. When I pick the
object I get this osgNode return by thefunction readNodeFile but I don't
know really how to modify the mesh (colour or something else) to show that
this mesh is selected.

Regards


__
Romain



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


Re: [osg-users] Modify Object After Picking

2008-02-15 Thread Paul Martz
Ah... Anyone remember PHIGS? Built-in pick highlighting that was almost
guaranteed to not be what your app wanted? :-) And a PITA to implement too.
 
You could take a look at the Scribe decorator node in osgFX. Just insert it
into your scene graph above the picked object, then the object will render
with a wireframe overlay.
 
Hope that helps,
 
Paul Martz
Skew Matrix Software LLC
http://www.skew-matrix.com http://www.skew-matrix.com/ 
303 859 9466


  _  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Romain
Blanchais
Sent: Friday, February 15, 2008 6:28 AM
To: OpenSceneGraph Users
Subject: [osg-users] Modify Object After Picking


Hello, 

I would like to know if there is a simple way to show if an object is
selected ?

When I load a mesh from a osg file I use readNodeFile. When I pick the
object I get this osgNode return by thefunction readNodeFile but I don't
know really how to modify the mesh (colour or something else) to show that
this mesh is selected.

Regards


__
Romain




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


Re: [osg-users] Modify Object After Picking

2008-02-15 Thread John Donovan
Gordon Tomlinson wrote:
 Another old school Performer way, would be to double draw your node once in
 normal mode and then a second time in wire frame mode

An extension to this, which I've read about but never implemented is, after 
rendering your object, set ztest to equal, switch to wireframe, set line 
thickness to 2 or 3 pixels, and render the backfaces of your object. You'll get 
a rather funky, and fairly cheap, silhouette of your object. AFAIK, this is how 
Modo does it's highlighting.

-JD


__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Modify Object After Picking

2008-02-15 Thread John Donovan
Paul Martz wrote:
 I have done this before, and the results are interesting but not high
 quality due to differences in line/polygon rasterization. Still a good trick
 nonetheless.
-Paul

Yeah, I've seen line rasterization on different graphics cards produce 
different results, and sometimes it's completely broken. Wasn't there a Linux 
ATI driver issue that made wireframes in OSG useless?
I guess a lot of the issues also depend on the geometry and the depth precision 
of the scene.


-JD


__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Modify Object After Picking

2008-02-15 Thread Paul Martz
 An extension to this, which I've read about but never 
 implemented is, after rendering your object, set ztest to 
 equal, switch to wireframe, set line thickness to 2 or 3 
 pixels, and render the backfaces of your object. You'll get a 
 rather funky, and fairly cheap, silhouette of your object. 
 AFAIK, this is how Modo does it's highlighting.

I have done this before, and the results are interesting but not high
quality due to differences in line/polygon rasterization. Still a good trick
nonetheless.
   -Paul

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


Re: [osg-users] Modify Object After Picking

2008-02-15 Thread Romain Blanchais
Thank you for your answers,

About the osgFX Scribe effect, I found a problem in the archive mail list
that when you apply this effect the object disappear few frames. Do you know
if it's still the case ?

http://archive.netbsd.se/?ml=openscenegraph-usersa=2006-11m=2558289

Regards

__
Romain


On Fri, Feb 15, 2008 at 2:28 PM, John Donovan 
[EMAIL PROTECTED] wrote:

 Paul Martz wrote:
  I have done this before, and the results are interesting but not high
  quality due to differences in line/polygon rasterization. Still a good
 trick
  nonetheless.
 -Paul

 Yeah, I've seen line rasterization on different graphics cards produce
 different results, and sometimes it's completely broken. Wasn't there a
 Linux
 ATI driver issue that made wireframes in OSG useless?
 I guess a lot of the issues also depend on the geometry and the depth
 precision
 of the scene.


 -JD


 __
 This email has been scanned by the MessageLabs Email Security System.
 For more information please visit http://www.messagelabs.com/email
 __
 ___
 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] Modify Object After Picking

2008-02-15 Thread Jean-Sébastien Guay
Hello Romain,

  I use the Scribe effect all the time (both at work and in my Masters
   project) and I've never seen that particular issue.
 
 But do you add the scribe effect in real time ?

Yes. Just be sure to do it in the update thread and make sure you don't 
do it while traversing (to not invalidate iterators) and you should be fine.

J-S

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