To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.devOpen lugnet.cad.dev in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / Development / 2901
2900  |  2902
Subject: 
Re: Hidden surface removal, and vertex order in part/primitive DAT files
Newsgroups: 
lugnet.cad.dev
Date: 
Mon, 27 Sep 1999 03:22:06 GMT
Viewed: 
420 times
  
In lugnet.cad.dev, Gary Williams writes:
I performed some hidden surface removal tests today (I should have been
working on other things, like the inventory file cleanup utility...) and it
appears that there isn't a standard order for listing vertices in DAT files
(I only tested a few elements, and my code may be flawed, so I may be
wrong).

A common technique in the rendering world is to always specify vertices of a
polygon in clockwise order (clockwise as viewed from the outside of the
polyhedra that contains it).  This cuts the rendering time in half by
allowing the rendering algorithm to ignore the polygons that face away from
the observer (assuming there are no transparent polygons through which the
observer might see the backside of another polygon).

This technique can also cut in half the amount of time required to determine
which polygon the user clicked on when selecting elements in a model, since
you can't click on a polygon that's facing away from you, so half the
polygons don't need to be tested.

So...I've got half a mind to write a utility that will load every existing
part and primitive file and analyze them and automatically tweak the vertex
orders of all the polygons.  But I thought I'd mention the idea first.

-Gary

If you run a LUGNET search on backface culling, you'll find extensive
discussion of this.  Some parts (mostly done by Steve Bliss) have a "0 CW-
Compliant" tag, which means you can use backface culling on them.

It would be pretty amazing if you could create a utility to automatically fix
other parts.  Even if you fix the vertex order of polygons, you have to worry
about the transformations applied to primitives and subparts in a part file.
And then you'd have to adjust for transformations applied to parts and
submodels in a model file.

Would be great to save 1/2 the rendering time, though.

-John Van



Message has 5 Replies:
  Re: Hidden surface removal, and vertex order in part/primitive DAT files
 
(...) I'd be mighty impressed, too, if you could do this automatically. For solid polyhedra, it's not too difficult as you can assume that the origin of the solid is within the material, but most Lego parts are re-entrent (ie. partly hollow), so (...) (25 years ago, 27-Sep-99, to lugnet.cad.dev)
  Re: Hidden surface removal, and vertex order in part/primitive DAT files
 
John VanZwieten wrote in message ... (...) fix (...) worry (...) file. (...) Thanks for the tip, I'll run a search. Actually I think I've worked out in my mind an automatic clockwise-sorting algorithm. It will fail for primitives like studs which (...) (25 years ago, 27-Sep-99, to lugnet.cad.dev)
  Re: Hidden surface removal, and vertex order in part/primitive DAT files
 
John VanZwieten wrote in message ... (...) I ran the search for 'backface culling', but it came up with four un-related articles. :( -GW (25 years ago, 27-Sep-99, to lugnet.cad.dev)
  Re: Hidden surface removal, and vertex order in part/primitive DAT files
 
(...) Actually, most of mine say "not CW-Compliant", as a notice to anyone coming along who wants to clean up the library. Steve (25 years ago, 27-Sep-99, to lugnet.cad.dev)
  Re: Hidden surface removal, and vertex order in part/primitive DAT files
 
You mentioned that some parts have a "0 CW-Compliant" tag. Could we do something to make this a standard? Because than I could read this tag in MLCad and make the drawing faster!!!!! Tell me what you think! Mike (...) John VanZwieten wrote in (...) (25 years ago, 1-Oct-99, to lugnet.cad.dev)

Message is in Reply To:
  Hidden surface removal, and vertex order in part/primitive DAT files
 
I performed some hidden surface removal tests today (I should have been working on other things, like the inventory file cleanup utility...) and it appears that there isn't a standard order for listing vertices in DAT files (I only tested a few (...) (25 years ago, 26-Sep-99, to lugnet.cad.dev)

56 Messages in This Thread:
















Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR