Re: [osg-users] Extracting visible geometry

2008-02-29 Thread Brian R Hill
John,

I re-read my post from last night and realize I wasn't answering your
question - how to calculate the visible surface area. I was answering a
different question - how to find all front facing surfaces without
considering occlusion.

I'm not sure how to find the exact visibile surface area, but you could
find the projected surface area - the area covered by the visible surfaces
projected on a plane. You'd clear the render target (frame buffer, texture,
FBO,...) to black or some other known color then render the scene normally,
writing the poly color and depth to the render target, then sample the
render target to determine which pixels are non-black. That will be the
projected visible surface area. If your polys are different colors then you
can determine the area for each color.

If you use the depth at each pixel you could determine the range of the
surface (at that pixel) and get a better estimate of the actual area, but
it won't account for the obliqueness of the surface at that pixel.

Look at the OSG prerender example, it renders to a texture and then saves
the texture to a file. You would do something similar, then read the
texture file to calc your areas.

You could achieve the same thing using fragment shaders, which would be
much faster, but that's much more involved and I don't know what your
performance requirements are.

Brian


-Brian R Hill/DEF/CSC wrote: -


To: OpenSceneGraph Users 
From: Brian R Hill/DEF/CSC
Date: 02/28/2008 04:24PM
Subject: Re: [osg-users] Extracting visible geometry

I'd use OSG for this, although not the rendering portions.

You'll need to learn a whole lot about the scenegraph structure, how to
traverse it, accumulate tranformations, how to access geometric elements
(tris, quads,..), how to access normals, vertexs, colors, front vs back
facing, 

All really fun stuff to learn, but it's going to take time.

However, once you know this stuff you'll be able to bang out this type of
analysis in no time - I figure I could do it in an hour or two.

Search on SmoothingVisitor and TriangleFunctor that should get you started.

Brian

[EMAIL PROTECTED] wrote: -


To: osg-users@lists.openscenegraph.org
From: "John Wilde" <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]
Date: 02/28/2008 03:43PM
Subject: [osg-users] Extracting visible geometry

Hello OSG users:

I am wondering what OSG can provide in solving the following problem:

Given a scene with on the order of 100s of simple geometry elements
(perhaps osg::Box types) and given an (x,y,z) position in that scene,
I'd like

1) A list of all polygonal planes that are *visible* from the given
point (in all directions).  For example, if the scene consisted of a
single Box (a building), and the given point was near a corner at the
base of that box, I'd like to know the two polygons describing the two
visible faces of the box (sides of the building).  If a portion of the
box was occluded (by other geometry in the scene), I'd like the
polygon that describes only the visible portion.  I am basically
interested in knowing the surface area of all the visible geometry in
the scene.

2) The distance from the given point to a point on the visible surface.

3) Color information associated with each visible surface plane.

Could someone suggest parts of the OSG API I should learn in order to
solve this problem?  Do you think OSG is the right tool for this sort
of analysis?

Thanks in advance for your help.

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

This is a PRIVATE message. If you are not the intended recipient, please
delete without copying and kindly advise us by e-mail of the mistake in
delivery. NOTE: Regardless of content, this e-mail shall not operate to
bind CSC to any order or other contract unless pursuant to explicit written
agreement or government initiative expressly permitting the use of e-mail
for such purpose.




This is a PRIVATE message. If you are not the intended recipient, please
delete without copying and kindly advise us by e-mail of the mistake in
delivery. NOTE: Regardless of content, this e-mail shall not operate to
bind CSC to any order or other contract unless pursuant to explicit written
agreement

Re: [osg-users] Extracting visible geometry

2008-02-28 Thread Brian R Hill
I'd use OSG for this, although not the rendering portions.

You'll need to learn a whole lot about the scenegraph structure, how to
traverse it, accumulate tranformations, how to access geometric elements
(tris, quads,..), how to access normals, vertexs, colors, front vs back
facing, 

All really fun stuff to learn, but it's going to take time.

However, once you know this stuff you'll be able to bang out this type of
analysis in no time - I figure I could do it in an hour or two.

Search on SmoothingVisitor and TriangleFunctor that should get you started.

Brian





[EMAIL PROTECTED] wrote: -


To: osg-users@lists.openscenegraph.org
From: "John Wilde" <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]
Date: 02/28/2008 03:43PM
Subject: [osg-users] Extracting visible geometry

Hello OSG users:

I am wondering what OSG can provide in solving the following problem:

Given a scene with on the order of 100s of simple geometry elements
(perhaps osg::Box types) and given an (x,y,z) position in that scene,
I'd like

1) A list of all polygonal planes that are *visible* from the given
point (in all directions).  For example, if the scene consisted of a
single Box (a building), and the given point was near a corner at the
base of that box, I'd like to know the two polygons describing the two
visible faces of the box (sides of the building).  If a portion of the
box was occluded (by other geometry in the scene), I'd like the
polygon that describes only the visible portion.  I am basically
interested in knowing the surface area of all the visible geometry in
the scene.

2) The distance from the given point to a point on the visible surface.

3) Color information associated with each visible surface plane.

Could someone suggest parts of the OSG API I should learn in order to
solve this problem?  Do you think OSG is the right tool for this sort
of analysis?

Thanks in advance for your help.

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

This is a PRIVATE message. If you are not the intended recipient, please
delete without copying and kindly advise us by e-mail of the mistake in
delivery. NOTE: Regardless of content, this e-mail shall not operate to
bind CSC to any order or other contract unless pursuant to explicit written
agreement or government initiative expressly permitting the use of e-mail
for such purpose.


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


[osg-users] Extracting visible geometry

2008-02-28 Thread John Wilde
Hello OSG users:

I am wondering what OSG can provide in solving the following problem:

Given a scene with on the order of 100s of simple geometry elements
(perhaps osg::Box types) and given an (x,y,z) position in that scene,
I'd like

1) A list of all polygonal planes that are *visible* from the given
point (in all directions).  For example, if the scene consisted of a
single Box (a building), and the given point was near a corner at the
base of that box, I'd like to know the two polygons describing the two
visible faces of the box (sides of the building).  If a portion of the
box was occluded (by other geometry in the scene), I'd like the
polygon that describes only the visible portion.  I am basically
interested in knowing the surface area of all the visible geometry in
the scene.

2) The distance from the given point to a point on the visible surface.

3) Color information associated with each visible surface plane.

Could someone suggest parts of the OSG API I should learn in order to
solve this problem?  Do you think OSG is the right tool for this sort
of analysis?

Thanks in advance for your help.

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