[osg-users] Question about plane intersections

2008-09-24 Thread Argentieri, John-P63223
Gentlemen,

Can anyone point me to something that would be useful in OSG for solving
the problem of making a set of contour lines similar to those seen on
maps? I'd like to provide osg with a plane and get the shape created by
the intersection with the plane.

Your advice is greatly appreciated.

Thanks,

John Argentieri


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


Re: [osg-users] Question about plane intersections

2008-09-24 Thread Jean-Sébastien Guay

Hi John,

Can anyone point me to something that would be useful in OSG for solving 
the problem of making a set of contour lines similar to those seen on 
maps? I'd like to provide osg with a plane and get the shape created by 
the intersection with the plane.


I'm sure others can provide more mathematically-inclined answers 
(perhaps even something already in OSG), but I could see doing that by 
making a shader that draws lines when the world-space Z coordinate is a 
given value (or a given multiple of a given value, or whatever).


Not sure how familiar you are with shader programming, but it should be 
pretty easy. Of course, if you need the result for other calculations 
rather than just for display (or if you need it to be arbitrary planes, 
or other things) this won't work.


Hope this helps,

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


Re: [osg-users] Question about plane intersections

2008-09-24 Thread Glenn Waldron
On Wed, Sep 24, 2008 at 1:02 PM, Argentieri, John-P63223 
[EMAIL PROTECTED] wrote:

  Gentlemen,

 Can anyone point me to something that would be useful in OSG for solving
 the problem of making a set of contour lines similar to those seen on maps?
 I'd like to provide osg with a plane and get the shape created by the
 intersection with the plane.

 Your advice is greatly appreciated.

 Thanks,

 John Argentieri


Have you looked into osgUtil::PlaneIntersector?  It will return the results
of an intersection at a set of polylines. You can then create osg::Geometry
from the polylines to visualize it.

Glenn


-- 
Glenn Waldron : Pelican Mapping : http://pelicanmapping.com :
+1.703.652.4791
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Question about plane intersections

2008-09-24 Thread Argentieri, John-P63223
Both very nice ideas. Thanks guys!




From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Glenn
Waldron
Sent: Wednesday, September 24, 2008 1:25 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Question about plane intersections


On Wed, Sep 24, 2008 at 1:02 PM, Argentieri, John-P63223
[EMAIL PROTECTED] wrote:


Gentlemen, 

Can anyone point me to something that would be useful in OSG for
solving the problem of making a set of contour lines similar to those
seen on maps? I'd like to provide osg with a plane and get the shape
created by the intersection with the plane.

Your advice is greatly appreciated. 

Thanks, 

John Argentieri 


Have you looked into osgUtil::PlaneIntersector?  It will return the
results of an intersection at a set of polylines. You can then create
osg::Geometry from the polylines to visualize it.


Glenn


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

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


Re: [osg-users] Question about plane intersections

2008-09-24 Thread David Spilling
John,

If you just want it visually in a map style format, you can texture the hill
with a banded texture, generate the texcoordinates based on a texgen node,
and then view it in ortho from the top.

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