Re: [Plib-users] CAM using plib was: Wanted--bitmap
Brought to you by:
sjbaker
From: Steve B. <sjb...@ai...> - 2001-04-24 23:57:41
|
Marlin Mixon wrote: > >So, if this works, you owe me a 2 foot tall foam model of Tux - OK? :-) > > You got it! Excellent! > A few additions to the algorithm. It appears that the MSFS models are > often non-contiguous meshes--a forward section of the fuselage placed next > to a rear section. Bummer. If there is merely a small gap or overlap then a first pass to 'snap' together adjacent vertices would be needed. What you need to do is to delete edges that are NOT shared *before* you backface cull the model - then after it's back-face culled, delete only edges that *ARE* shared. Hence only edges that changed from being shared to non-shared *because* you backface culled will show up as profile edges. That's not a bullet-proof strategy...but it'll do. > So I think the following changes are in order: > > * You have to build a linked list structure of 3-d verticies in order to > detect non-contiguousity. (Hey! A brand new word!) > * Plot a final graph. Each 2-D vertex needs an attribute telling it > which 3-d network it came from. > * On the final 2-D graph, check each remaining edge too see if it > intersects with any other edge. If so fix the graph so there's a > vertex there. Yes - but they may not intersect. ______________________ | | | | | | |___________|_ A | | | | | |___________|_|B | |______________________| The edge A/B doesn't intersect anything - but it does need to be discarded. > * For each vertex, do a point in polygon to see if that point lies in > any OTHER polygon and if so delete it. Point-in-polygon tests can't work in 3D. > I kind of like the hybrid idea. Any opinions? Any pitfalls? I would *strongly* recommend you stay clear of raster-based hacks. -- Steve Baker HomeEmail: <sjb...@ai...> WorkEmail: <sj...@li...> HomePage : http://web2.airmail.net/sjbaker1 Projects : http://plib.sourceforge.net http://tuxaqfh.sourceforge.net http://tuxkart.sourceforge.net http://prettypoly.sourceforge.net http://freeglut.sourceforge.net |