hi georg

> As I understand the index/vertex data is not a mere Basis for triangles.
> Unfortunately I have an application that only deals with triangle mesh
> data. How would I make sure, that a geometry consists of triangle mesh data
> only? Can I call a function that breaks up poly and quad data into
> triangles?

take a look at the triangle iterator, it does an implicit triangulation of a 
geometry object:

http://www.opensg.org/doc-1.6.0/PageSystemGeometry.html#PageSystemTriangleIterator

cheers,
simon

>
> Thank you very much in Advance, Georg.
>
>
> Hello Georg,
>
> Wünsch wrote:
> > Hi Everybody,
> > I am trying to extraxt vertices and indices
> > from a Geometry into an Array and just cant
> > get the clue, please somebody help me out,
> > I guess its pretty simple:
> >
> > NodePtr node;
> > NodeCorePtr core = node->getCore();
> >
> > string type(core->getTypeName());
> > if (type == "Geometry") { // BTW: can I do this faster?
> >
> >    GeometryPtr geo = GeometryPtr::dcast(core);
>
> the faster way to do this:
>
> NodePtr node;
> GeometryPtr geo = GeometryPtr::dcast(node->getCore());
>
> if(geo != NullFC)
> // ...
>
> > // and now I am lost.
> > // where I want to get to is something like this:
> >
> > int num_vertices;
> > float* vertices[];
> > geo->getVertices(num_vertices, vertices);
>
> GeoPositionsPtr verts = geo->getPositions();
>
> verts->getSize();       // returns number of vertices
> verts->getValue(index); // returns vertex index as Pnt3f (independent
> from the actual type stored)
>
> // for efficient access
> GeoPositions3fPtr verts3f = GeoPositions3fPtr::dcast(verts);
> GeoPositions3f::StoredFieldType &vertField = verts3f->getField();
>
> vertField->size(); // returns number of vertices
> vertField[index];  // returns vertex index as Pnt3f
>
> > int num_indices;
> > int* indices[];
> > geo->getIndices(num_indices, indices);
>
> this is similar as above, just replace "Positions" with "Indices".
>
> > How can I copy the
> > vertex and index data from the Geometry
> > into the two arrays? I guess something
> > similar should happen when the opengl
> > content is actually being drawn. But I
> > cant find it. please help me.
>
> More information on this can be found in the tutorial, which also
> explains the different indexing methods. The tutorial can be found here:
> <http://opensg.vrsource.org/trac/wiki/Tutorial>, the page on geometry is
> here: <http://opensg.vrsource.org/trac/wiki/Tutorial/OpenSG1/Geometry>
>
>       Hope it helps,
>               Carsten
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Opensg-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/opensg-users



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to