Hello Carsten, -------- Original-Nachricht -------- > Datum: Fri, 03 Jun 2011 16:15:03 -0500 > Von: Carsten Neumann <carsten_neum...@gmx.net> > An: opensg-users@lists.sourceforge.net > Betreff: Re: [Opensg-users] Problems processing line strips
> Hello Daniel, > > I haven't had a chance to look at the code yet, thanks for providing the > test file though! > > On 06/03/2011 10:43 AM, Daniel Weber wrote: > > I'm using OpenSG2.0 to read line strips out of a .wrl file and process > them afterwards. I've attached a sample file containing three line strips. > In principle these line segments are connected, i.e., they represent a > closed curve. I have some trouble with the whole process and I do not know if > there are bugs or I'm missing something. > > > > 1) When reading the file, GL_LINES instead of GL_LINE_STRIPS are > generated in the geometry core. A simple example shows the issue: At the end > of > the following code snipplet, the type of the geometry core is GL_LINES > instead of GL_LINE_STRIP. > > hmm, that seems to be a case where the VRML loader/writer has taken a > shortcut and just does not attempt to create LINE_STRIPS where it makes > sense. But writing and reading the geometry results in a different visualization. When rendering the first node (before writing to "test.wrl") you can see a straight line, while the one after the read results in a line stipple. > > > I fixed that in my application by traversing the generated scene graph > and replacing all GL_LINES with GL_LINE_STRIP. > > that gives the expected visual result, but is a bit wasteful as you will > have line segments of length 0 in the strip. > > > 2) In a second step I need to merge all geometry cores into one. As the > geometry is spread over the whole the scenegraph and the GeometryMergeOp > only works with direct children, I collected all geometry cores and put them > "below" a group node ("newScene"). The merge operation works in principle, > but it always results in two geometry cores: one with the merged geometry > and another one. I assume that the "second" one is simply not deleted in the > final step. Here is the code: > > that does indeed sound like a bug. > > > 3) In the third step, I call "createSharedIndex" in order to merge > vertices that belong more than on line segment (these are the start- and > end-vertices of the line strips.) With the attached file, only two of the > three > start-vertices are merged with the corresponding end-vertex. What may be the > reason?) > > > > 4) Finally, I would like to make one linestrip out of the geometry. But > the StipeGraphOp does not seem to work for linestrips (only tri- and > quadstrips?) > > yes, the striper only handles triangle strips. > > In general the GraphOps are meant to perform optimizations that are > applicable to all models so they may not necessarily give optimal > results for specific cases like yours. That is not to say that the > behaviour you are seeing indicates bugs that should be fixed, just that > it may be hard to get the generic GraphOps to produce the exact result > you are expecting. > I would recommend considering to write your own GraphOp for the specific > scene/optimization you require. Merging Geometry that is known to only > contain line strips should not be very difficult and it's much easier to > get the optimal representation you are looking for that way than by > tweaking the generic code. Yes, I did that already, but not as a OpenSG GraphOp. If I have some time, I can transform the code into an OpenSG compatible one and make it available for you. Regards, Daniel > > Cheers, > Carsten > > ------------------------------------------------------------------------------ > Simplify data backup and recovery for your virtual environment with > vRanger. > Installation's a snap, and flexible recovery options mean your data is > safe, > secure and there when you need it. Discover what all the cheering's about. > Get your free trial download today. > http://p.sf.net/sfu/quest-dev2dev2 > _______________________________________________ > Opensg-users mailing list > Opensg-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/opensg-users -- NEU: FreePhone - kostenlos mobil telefonieren! Jetzt informieren: http://www.gmx.net/de/go/freephone ------------------------------------------------------------------------------ Simplify data backup and recovery for your virtual environment with vRanger. Installation's a snap, and flexible recovery options mean your data is safe, secure and there when you need it. Discover what all the cheering's about. Get your free trial download today. http://p.sf.net/sfu/quest-dev2dev2 _______________________________________________ Opensg-users mailing list Opensg-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensg-users