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 / 3533
3532  |  3534
Subject: 
Dat format question - Quad line order
Newsgroups: 
lugnet.cad.dev
Date: 
Wed, 22 Dec 1999 12:42:28 GMT
Viewed: 
373 times
  
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.



Message has 2 Replies:
  Re: Dat format question - Quad line order
 
(...) 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 (...) (25 years ago, 22-Dec-99, to lugnet.cad.dev)
  Re: Dat format question - Quad line order
 
"Johannes Keukelaar" <johannes@nada.kth.se> wrote... (...) Yes. (...) It is known as a bow-tie quad, and is found many places! (...) Yes, this is sadly the way they are ordered in many files. Another problem is that the four points may not be (...) (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