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 / 2899
  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)
 
  Re: Hidden surface removal, and vertex order in part/primitive DAT files
 
(...) 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 (...) (25 years ago, 27-Sep-99, to lugnet.cad.dev)
 
  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
 
Chris Dee wrote in message ... (...) partly (...) plastic. (...) is a (...) The algorithm I came up with yesterday will handle such cases. Basically for every face in a polygon, I'll pass a ray through it and count the number of polygons that it (...) (25 years ago, 27-Sep-99, to lugnet.cad.dev)
 
  Re: Hidden surface removal, and vertex order in part/primitive DAT files
 
(...) That should have read, for every polygon in the element or primitive. (25 years ago, 27-Sep-99, to lugnet.cad.dev)
 
  Re: Hidden surface removal, and vertex order in part/primitive DAT files
 
(...) I couldn't find anything either, maybe the archive has a limit or it was discussed in the L-CAD list ? The only related message I found was (URL) but the discussion started several months before that. Leonardo (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
 
(...) The main discussion was on the mailing list. I can check my home machine, to see if I have it archived. Anyone else keep copies of the L-CAD messages? Steve (25 years ago, 27-Sep-99, to lugnet.cad.dev)
 
  Re: Hidden surface removal, and vertex order in part/primitive DAT files
 
(...) I do have some old messaged but I couldn't find that thread, do you need anything to complete your collection ? :) If the list still exists, then maybe the archive is there too ? Leonardo (25 years ago, 28-Sep-99, to lugnet.cad.dev)
 
  Re: Hidden surface removal, and vertex order in part/primitive DAT files
 
Hello, Ok guys, I already announced that I coded such a tool in Java. At present, only one Ldrawer has asked for the code. In fact, it's an alpha release. Thus, I should find beta testers first. Anyway it has already translated some pieces! Here is (...) (25 years ago, 30-Sep-99, to lugnet.cad.dev)
 
  Re: Hidden surface removal, and vertex order in part/primitive DAT files
 
Jean-Pierre PARIS wrote in message <37F3B871.74AE196F@w...doo.fr>... (...) My algorithm doesn't require the vertices to exactly match; I was intending to pass one ray per polygon through the dat object, not an arbitrarily large number. And only if (...) (25 years ago, 30-Sep-99, to lugnet.cad.dev)
 
  Re: Hidden surface removal, and vertex order in part/primitive DAT files
 
Gary Williams wrote in message ... (...) Okay, I made a bad assumption there, since a group of polygons may terminate flush against another polygon, without touching its edges. But still I think a performance improvement could be realized by using (...) (25 years ago, 30-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)
 
  Re: Hidden surface removal, and vertex order in part/primitive DAT files
 
Michael Lachmann: (...) I think we agreed to use 0 CW and 0 CCW lines in the beginning of the files to indicate (C)CW compliancy, but you should have a look at what Steve actually has written in his parts. (...) It would be very nice if you (...) (25 years ago, 1-Oct-99, to lugnet.cad.dev)
 
  Re: Hidden surface removal, and vertex order in part/primitive DAT files
 
(...) I'm willing to change my parts, if the standard changes. Assuming parts which are *not* C(C)W need to be flagged at all. (...) I agree completely. Steve (25 years ago, 1-Oct-99, to lugnet.cad.dev)
 
  Re: Hidden surface removal, and vertex order in part/primitive DAT files
 
(...) I guess we could at least decide to use CCW to determine the normal of a face, unless there's someone who prefers to use CW ? Leonardo (25 years ago, 1-Oct-99, to lugnet.cad.dev)
 
  Re: Hidden surface removal, and vertex order in part/primitive DAT files
 
Leonardo Zide wrote in message <37F4ECA7.C0BFCF7D@c...com.br>... (...) I'd vote for CW for two reasons: 1) 'Clockwise' is shorter than 'counterclockwise'. 2) CW is used more often than CCW in rendering applications (to my knowledge) because the (...) (25 years ago, 1-Oct-99, to lugnet.cad.dev)
 
  Re: Hidden surface removal, and vertex order in part/primitive DAT files
 
(...) I can't argue with that :) (...) No way ! The front faces are CCW in 3DS Max, and quoting the OpenGL 1.2 specs. for glFrontFace() "mode: Specifies the orientation of front-facing polygons. GL_CW and GL_CCW are accepted. The initial value is (...) (25 years ago, 1-Oct-99, to lugnet.cad.dev)
 
  Re: Hidden surface removal, and vertex order in part/primitive DAT files
 
What if say a complient file contains anything starting with "0 CW". Any program dealing with this information could just scan for "0 CW*". We also could use a tag "0 AW*" if why ever the orientation is not clock-wice but anti-clockwice .... I think (...) (25 years ago, 2-Oct-99, to lugnet.cad.dev)
 
  Re: Hidden surface removal, and vertex order in part/primitive DAT files
 
Michael Lachmann wrote in message ... (...) I retract my earlier suggestion. I'd prefer to test for '0 CW-compliant' than '0 CW*' because checking for an exact string match is usually easier. Not supporting wildcards also promotes consistency. (...) (25 years ago, 2-Oct-99, to lugnet.cad.dev)
 
  Re: Hidden surface removal, and vertex order in part/primitive DAT files
 
Gary Williams: (...) I still think using 0 FACE ( CW | CCW | DOUBLE-SIDED | UNKNOWN ) is most practical. Play well, Jacob ---...--- -- E-mail: sparre@cats.nbi.dk -- -- Web...: <URL:(URL) -- ---...--- (25 years ago, 2-Oct-99, to lugnet.cad.dev)
 
  Re: Hidden surface removal, and vertex order in part/primitive DAT files
 
(...) Sorry, but I think that the even/odd algorithm only work on 'correct' solids. For example, if you take a 'bad' box made of 6 faces that have holes beween them, your algorithm can lit an inside face. And in some parts, such a situation exists. (...) (25 years ago, 2-Oct-99, to lugnet.cad.dev)
 
  Re: Hidden surface removal, and vertex order in part/primitive DAT files
 
Jacob Sparre Andersen wrote in message ... (...) That works for me. I don't suppose there's an official standards-setting body of people charged with voting on extensions to the .dat format, is there? Maybe it's time to form one. -Gary (25 years ago, 2-Oct-99, to lugnet.cad.dev)
 
  Re: Hidden surface removal, and vertex order in part/primitive DAT files
 
(...) This isn't automatic, but what if the program interrogates the user to pick a side which is facing outward? From that information, the program could then mark-up all adjacent sides. If the program ran out of sides, it could re-interrogate for (...) (25 years ago, 3-Oct-99, to lugnet.cad.dev)
 
  Re: Hidden surface removal, and vertex order in part/primitive DAT files
 
Jean-Pierre PARIS wrote in message <37F660FB.1EC77AC9@w...doo.fr>... (...) I see where you're coming from now. You're right. (...) could (...) It's starting to sound like user intervention would be needed in most, if not all, cases. Maybe it would (...) (25 years ago, 3-Oct-99, to lugnet.cad.dev)
 
  Re: Hidden surface removal, and vertex order in part/primitive DAT files
 
Steve Bliss wrote in message <37f6c0d9.269680202@...et.com>... (...) Doh, you posted mere minutes before me and said the same thing. :) -Gary (25 years ago, 3-Oct-99, to lugnet.cad.dev)
 
  Re: Hidden surface removal, and vertex order in part/primitive DAT files  [DAT]
 
(...) 578 is compliant because it contains *only* subfile references, which have been verified to not mess up (C)CW-ness. But that doesn't mean the *subfiles* are compliant. It also assumes the compliant subfiles are oriented the way the author (me) (...) (25 years ago, 3-Oct-99, to lugnet.cad.dev)
 
  Re: Hidden surface removal, and vertex order in part/primitive DAT files
 
(...) We're it. So to speak. Steve (25 years ago, 3-Oct-99, to lugnet.cad.dev)
 
  Re: Hidden surface removal, and vertex order in part/primitive DAT files
 
(...) Instead of asking the user, the program could first try to cast rays and then only if there are any faces left it asks the user. I've started writing my own converter and it worked correctly with the 'standard' bricks but had a few problems (...) (25 years ago, 3-Oct-99, to lugnet.cad.dev)
 
  Re: Hidden surface removal, and vertex order in part/primitive DAT files
 
(...) you should consider that there are a lot of such groups of sides in one brick! Thus, the approach described by Leonardo is better: (...) Now, my main problem is: how can I find enough time to translate and check all the bricks! I guess my (...) (25 years ago, 3-Oct-99, to lugnet.cad.dev)
 
  Re: Hidden surface removal, and vertex order in part/primitive DAT files
 
(...) I really don't like programs that need user interactions for such job! Thus I tried to cast enough rays so that all the faces are being oriented correctly. Now all the std bricks are OK, without any assumption about the fact that they are (...) (25 years ago, 3-Oct-99, to lugnet.cad.dev)
 
  Re: Hidden surface removal, and vertex order in part/primitive DAT files
 
Steve Bliss wrote in message <37f6c258.270062819@...et.com>... (...) 30 (...) Does that mean if a program would find the CW directive it can assume that every-thing in this file is compliant? E.g. the program would not have to test if possible (...) (25 years ago, 4-Oct-99, to lugnet.cad.dev)
 
  Re: Hidden surface removal, and vertex order in part/primitive DAT files
 
Jacob Sparre Andersen wrote in message ... (...) also (...) but (...) the (...) an (...) Is this the standard now, or at least could we make it the standard ???? Mike (25 years ago, 4-Oct-99, to lugnet.cad.dev)
 
  Interpreting the proposed FACE meta-command
 
Michael Lachmann wrote in message ... (...) Here's my take on the matter. The meta-command: 0 FACE <CW|CCW|DS|UNKNOWN> ...should only be used to indicate the order of the vertices of the polygons _in the file that contains it_. If A.dat has a '0 (...) (25 years ago, 4-Oct-99, to lugnet.cad.dev)
 
  Re: Interpreting the proposed FACE meta-command
 
Gary Williams: (...) Very sensible (now that Steve has convinced me). (...) Hmm. I don't like it, but we have already abbreviated (counter)clockwise, so it does make sense to abbreviate double-sided too. :-( Play well, Jacob ---...--- -- E-mail: (...) (25 years ago, 4-Oct-99, to lugnet.cad.dev)
 
  Re: Interpreting the proposed FACE meta-command
 
Jacob Sparre Andersen wrote in message ... (...) I was just trying to be consistent...:) I'd be just as happy if they were all spelled-out. But I'd like to avoid supporting both abbreviations and the complete spelling. Every additional test that (...) (25 years ago, 4-Oct-99, to lugnet.cad.dev)
 
  Re: Hidden surface removal, and vertex order in part/primitive DAT files
 
(...) You need to have someone to check the parts, take a look at the picture at (URL) (from 105.DAT), there's a missing face and the program won't be able to handle that. There are other parts like that, just start checking and you'll see. Leonardo (...) (25 years ago, 4-Oct-99, to lugnet.cad.dev)
 
  Re: Hidden surface removal, and vertex order in part/primitive DAT files
 
(...) Neither do I, but I also know how hard it is to visually check a part for errors. (...) How does that work? Is it based on what the majority of the rays deterimine? I probably need to re-read some of the messages in this thread, to get a (...) (25 years ago, 4-Oct-99, to lugnet.cad.dev)
 
  Re: Hidden surface removal, and vertex order in part/primitive DAT files
 
(...) That's what we're doing now--figuring out what the standard should be. Both the function and the syntax. But "standard" is an odd term in this case. In my mind the LDraw standard is defined as "code which is recognized and interpreted by (...) (25 years ago, 4-Oct-99, to lugnet.cad.dev)
 
  Re: Hidden surface removal, and vertex order in part/primitive DAT files
 
(...) No (like Gary said). Two reasons: 1. The 0 FACE directive would be an operative switch, not a global setting. This is convenient, but it is also necessary in some cases. Most importantly, it would allow the 0 FACE meta-statement to appear (...) (25 years ago, 4-Oct-99, to lugnet.cad.dev)
 
  Re: Interpreting the proposed FACE meta-command
 
(...) Why not recognize it all ways: 0 FACE ACW 0 FACE ANTICLOCKWISE 0 FACE CCW 0 FACE CLOCKWISE 0 FACE COUNTERCLOCKWISE 0 FACE CW 0 FACE DOUBLESIDED 0 FACE DS 0 FACE UNKNOWN This adds a bit to the parser, but not so much. The recommended standard (...) (25 years ago, 4-Oct-99, to lugnet.cad.dev)
 
  Re: Hidden surface removal, and vertex order in part/primitive DAT files  [DAT]
 
(...) Forgot the footnote: 1- There's an interesting distinction between 'valid' and 'well-formed' contructions. LDraw will allow line-breaks as whitespace in commands, so: 1 16 0 0 0 1 0 0 0 1 0 0 0 1 3001.dat is valid, but it's not well-formed. (...) (25 years ago, 4-Oct-99, to lugnet.cad.dev)
 
  Re: Interpreting the proposed FACE meta-command
 
(...) Recognizing multiple forms of the command shouldn't add much to rendering. Each file can be parsed once, and then the post-parsing results cached, for later re-reference. The FACE meta-command would be stored as an opcode and a single (...) (25 years ago, 4-Oct-99, to lugnet.cad.dev)
 
  Re: Interpreting the proposed FACE meta-command
 
Steve Bliss wrote in message <37f8c4a9.238320530@...et.com>... (...) Well, I have nothing against anticlockwise, but it's redundant. Seeing ACW where one expects CW or CCW may confuse some people. I checked the dictionary because I honestly didn't (...) (25 years ago, 4-Oct-99, to lugnet.cad.dev)
 
  Re: Hidden surface removal, and vertex order in part/primitive DAT files
 
(...) Sorry Leonardo, but I checked 105 again my code: it does the right job! Ok, you can argue it's pure luck. In fact, it is! If a ray went through the hole between the flag and the rest of the piece, my code would invert the flag orientation. (...) (25 years ago, 5-Oct-99, to lugnet.cad.dev)
 
  Re: Hidden surface removal, and vertex order in part/primitive DAT files
 
(...) I choose rays so that they may orient one face. With this face I use a sort of flood-fill algorithm (please try to find on of my previuos message) to orient al neighbors. Once a face is oriented, I don't look at it anymore. But, your idea (...) (25 years ago, 5-Oct-99, to lugnet.cad.dev)
 
  Re: Hidden surface removal, and vertex order in part/primitive DAT files
 
(...) OK, then help out a Java-dummy: are there JDK's available on the net, or are they purchase-only? Steve (25 years ago, 6-Oct-99, to lugnet.cad.dev)
 
  Re: Hidden surface removal, and vertex order in part/primitive DAT files
 
(...) I guess you can download one from (URL) (25 years ago, 6-Oct-99, to lugnet.cad.dev)
 
  Re: Hidden surface removal, and vertex order in part/primitive DAT files
 
(...) My code worked too but my point was to say that the part is not correct, there could be some cases where it won't work and besides that, it won't look good if you render it with a program that has backface culling. How are you going to save (...) (25 years ago, 6-Oct-99, to lugnet.cad.dev)
 
  Re: Hidden surface removal, and vertex order in part/primitive DAT files
 
(...) In this sense we agree! It would be a shame if after a so long emails exchange we didn't ;-) (...) I read .dat files in the std LDraw folders, and simply output oriented .dat files in another one. For duplicate instances, I use a folder name (...) (25 years ago, 6-Oct-99, to lugnet.cad.dev)
 
  Re: Hidden surface removal, and vertex order in part/primitive DAT files
 
(...) Sun's implementations are free. Some others are not. Personally I use Sun's jdks... Have a look at: (2 URLs) you are under a Windows environment As a reply to Leonardo msg: You are right, but I encourage newcomers to the Java language to use (...) (25 years ago, 6-Oct-99, to lugnet.cad.dev)
 
  Re: Hidden surface removal, and vertex order in part/primitive DAT files
 
(...) Thank you very much! Steve (25 years ago, 7-Oct-99, to lugnet.cad.dev)
 
  Re: Hidden surface removal, and vertex order in part/primitive DAT files
 
(...) Ok, I can announce that my code actually orient ~10000 faces of 2560, BUT 4. In a previous version, 40 faces remain unoriented. After I checked all distances between the ~12000 of the part, I have discovered that some distances were very (...) (25 years ago, 15-Oct-99, to lugnet.cad.dev)
 
  Re: Hidden surface removal, and vertex order in part/primitive DAT files
 
Hello! Eventually I finished orienting (automatically) all faces of bricks 10 and 2560! For those who are interested by the results, please have a look at (URL) the same place, one'll find the corrected 2560. Yes, this part as small bugs: 16 faces (...) (25 years ago, 21-Nov-99, to lugnet.cad.dev)

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