Re: [osg-users] OSG Node to Mesh

2008-05-09 Thread deepu
Hi Everyone

Thanks for the help, and let me check it out.
Regards
Deepu.LR

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Will
Dicharry
Sent: Friday, May 09, 2008 7:53 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] OSG Node to Mesh

Hi Deepu,

In addition to writing a node visitor to traverse the scene graph and 
move from node to node accumulating transforms, one thing I have done in 
the past to get the geometry information once the visitor reaches a 
scene graph leaf is extending osg::PrimitiveFunctor or 
osg::PrimitiveIndexFunctor to get geometry information from the 
drawable.  This also follows the visitor pattern, allowing the geometry 
to describe itself to you.  From these classes you can store the 
geometry to whatever data structure you need for your physics model.  I 
believe the osg::TriangleIndexFunctor template class provides a nice 
implementation of the PrimitiveIndexFunctor methods for triangle based 
geometry and allows you to specify the processing function via a functor 
object (struct with overloaded operator()).  Hope this helps.

Will

Jean-Sébastien Guay wrote:
> Hello Deepu,
>
>> I am working on a simulation project in which I have to 
>> define an OSG node in the physics world (Bullet Physics). Can any one 
>> guide me towards a method by which I can convert an OSG node to a 
>> mesh so that I can define it in the physics world.
>
> In general, you would write a node visitor that given your node, would 
> extract the vertices and triangles. Then you would give those to your 
> physics engine. You'll have to figure out the particular format of the 
> mesh the physics engine expects, of course. We can't help you with that.
>
> There is some code in the OBJ writer 
> (src/osgPlugins/obj/OBJWriterNodeVisitor.{cpp|h}) which you could use 
> as an example of how to extract vertices and triangles from a geometry 
> object.
>
> Hope this helps,
>
> J-S
___
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 Node to Mesh

2008-05-09 Thread deepu
Hello Everyone,

 

I am working on a simulation project in which I have to define
an OSG node in the physics world (Bullet Physics). Can any one guide me
towards a method by which I can convert an OSG node to a mesh so that I can
define it in the physics world. 

 

Regards

Deepu.LR

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


[osg-users] AP203 and OSG

2008-03-25 Thread deepu
Hi all

I am newbie to Openscenegraph.  I am developing a simulation
application, which involves the simulation of mechanical parts. I have to
import the CAD models from a STEP (AP203) file and render the models using
OSG. 

 

One solution what I have in mind is,

 

1)   Using OpenCascade for reading the STEP files and tries to render
using the OSG.

2)   But how to transfer the SOLID model data from OCC to OSG?

3)   What are the different methods/approaches, I should try to display
the SOLID models in OSG.

4)   Can anybody give some hints or directions which will help me to
finally reach the goal?

 

 

Regards

Deepu.LR

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