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 / 3535
3534  |  3536
Subject: 
Re: Dat format question - Quad line order
Newsgroups: 
lugnet.cad.dev
Date: 
Wed, 22 Dec 1999 13:55:12 GMT
Viewed: 
844 times
  
"Johannes Keukelaar" <johannes@nada.kth.se> wrote...
The quad intended to be filled is this one:

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

Is this correct?

Yes.

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.

It is known as a bow-tie quad, and is found many places!

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?

Yes, this is sadly the way they are ordered in many files.
Another problem is that the four points may not be co-planar.

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?

LDraw simply transforms all the points to the screen,
and then fills the polygon spanned.
LDLite sometimes draws three triangles.
L3P fixes bow-ties (try "l3p -check -w3 2850").
See L3P's L3Input.cpp and LDLite sourcefiles in
http://www.netby.net/Nord/Mandelvej/Hassing/test/l3dlites.zip

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?

Yes, it should be fixed.
I believe the general opinion is that quads should be non-bow-tie and coplanar.
About concave/convex I really don't remember. The only problem with concave
quads is, that you have to be careful when splitting into two triangles.

For much more info on quads, please read http://www.lugnet.com/cad/dev/?n=2919
/Lars
-------------------------------------------------------------------------
Lars C. Hassing   "No sense being pessimistic. It wouldn't work anyway."
L3P page: http://www.netby.net/Nord/Mandelvej/Hassing/l3p.html
Homepage: http://www.netby.net/Nord/Mandelvej/Hassing/index.html



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