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 / 3534
3533  |  3535
Subject: 
Re: Dat format question - Quad line order
Newsgroups: 
lugnet.cad.dev
Date: 
Wed, 22 Dec 1999 13:38:37 GMT
Viewed: 
331 times
  
In lugnet.cad.dev, Johannes Keukelaar writes:
Hi all,

I've read the LDraw FAQ relating to the .dat file
format. Specifically:

--BEGIN-FAQ--
Quadrilateral command.
   Draws a four-sided, filled shape between four points.
   Line format:
       4 colour x1 y1 z1 x2 y2 z2 x3 y3 z3 x4 y4 z4
   where
       colour is a colour code: 0-15, 16, 24, 32-47, 256-511
       x1, y1, z1 is the position of the first point
       x2, y2, z2 is the position of the second point
       x3, y3, z3 is the position of the third point
       x4, y4, z4 is the position of the fourth point
--END-FAQ--

However, there are many different quads you can draw with four
points. I assume that if the four points (p1, p2, p3, p4) have
coordinates like this:

p1        p2




p4        p3


The quad intended to be filled is this one:

p1--------p2
|         |
|         |
|         |
|         |
p4--------p3

Is this correct?

I seem to have found some places, though, where the quad thus
constructed is not simple, i.e. has intersecting edges. An example may
be:

p1-----p2
\    /
  \  /
   \/
   /\
  /  \
/    \
p3-----p4

I have noticed this specifically in part 2850 (but also in other
places), in the side walls of the partial studs on the top of this
part.

Is this a bug in my rendering code (and a similar bug in my strange
quad detection code) that is only triggered for certain rare cases?
(I've tried rendering everything with p3 and p4 swapped; then these
few quads look normal, but all the other ones are now strange.) Or is
this really the way the data in the dat file is ordered?

If this is really what the dat file says, surely it can't be intended
that way? How do other dat renderers deal with this? Even if this
could be patched up in code (i.e. swap, in this case, p3 and p4),
surely this is something that must be fixed in the dat files when we
get around to implementing back face culling?

Confused regards,

Johannes.
--
To err is human. To grr is canine.

Virtually researching virtual behaviour in a virtual world.

You are correct that the co-ordinates _should_ define a simple loop without
crossing. The rendering algorithm in the original LDraw program was not
sensitive to this, so errors crept into the parts files. There was a move some
time back to correct the existing parts, and Lars Hassing's L3P program
(http://www.netby.net/Nord/Mandelvej/Hassing/l3p.html) has a useful -check
option to detect these errors. In recent times, I believe parts with such
errors have not passed the voting. When submitting new parts, running L3P
-check is one of my final QC checks.

Maybe we should renew our efforts to clean up the existing errors, when the
parts update process gets restarted? I'm happy to help share this work.

Chris



Message is in Reply To:
  Dat format question - Quad line order
 
Hi all, I've read the LDraw FAQ relating to the .dat file format. Specifically: --BEGIN-FAQ-- Quadrilateral command. Draws a four-sided, filled shape between four points. Line format: 4 colour x1 y1 z1 x2 y2 z2 x3 y3 z3 x4 y4 z4 where colour is a (...) (25 years ago, 22-Dec-99, to lugnet.cad.dev)

3 Messages in This Thread:


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

Custom Search

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