[email protected] schrieb am 07.06.05 15:35:16:

Hi Dirk,


>Hi Andi,
>
>On Tue, 2005-06-07 at 15:08 +0200, Andreas Brüning wrote:
>
> i have a geometry with a lot of lines. There are only lines. I loaded
> it from a vrml- file. I want to copy the points of every line in a
> multimap, so in the end, there are two points in every entry of the
> multimap. How can i get the points of every line? Can i get them with
> the primitiv- Iterator?

>Yup, only the PrimitiveIterator will give you lines. You need to find
>the Geometry Node with those lines first (either looking for the name or
>walking the tree, see 10loading.cpp) and then run a PrimtiveIterator on
>it. You can start with the following snippet (after testIterators.cpp):
>
>PrimitiveIterator pi;
>
>for ( pi = g->beginPrimitives(); pi != g->endPrimitives(); ++pi )
>{
>std::cerr << "Primitive " << pi.getIndex() << ": "
><< Geometry::mapType( pi.getType() ) << " with "
><< pi.getLength() << " points" << std::endl;
>for ( j = 0; j < pi.getLength(); j++ )
>{
>std::cerr << "Point " << j << ": " << pi.getPositionIndex( j )
><< ": " << pi.getPosition( j );
>}
>}
>
>If you find primitives of type 1,2 or 3 (GL_LINES, GL_LINE_LOOP,
>GL_LINE_STRIP), those are lines. How to interpret the points and how to
>split it into 2-point lines depends on the type, see an OpenGL book for
>that.
>
>Hope it helps
>
>Dirk


thanks for your quick help.

It works, but there is only one point: pi.getPostion(j); for each entry. Where i can find the other? If i put the j- Point and the j+1 point together, i see only the half of the modell. With the snippet, i found out, that there is one primitive with lines and nearly 15000 points. When i check the vrml- Modell(which i load), there are 15000 lines. Where i can find the other half?

-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users



Verschicken Sie romantische, coole und witzige Bilder per SMS!   
Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193  
------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput a projector? How fast can you ride your desk chair down the office luge track? If you want to score the big prize, get to know the little guy. Play to win an NEC 61" plasma display: http://www.necitguy.com/?r _______________________________________________ Opensg-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to