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 / 3474
3473  |  3475
Subject: 
Re: Line in the Sand
Newsgroups: 
lugnet.cad.dev
Date: 
Tue, 14 Dec 1999 22:13:04 GMT
Viewed: 
2592 times
  
[ Still discussing
  http://www.geocities.com/SouthBeach/Lagoon/8641/bfcspecv4.txt ]

Steve:

You can also put them on ldraw.org now that you have an
account here.

It's an admin role vs. personal role thing.  I took it
upon myself to write up a spec, I didn't want to imply
that it was endorsed by the group at large.

That makes sense.

Here comes a commented/edited version. Lines starting with
"#" are my comments and lines starting with "J" are my
changes/additions.

I'll reuse the notation.

--------------------------------------------------------------------------------
9 Inversion accumulates down the reference branch.  If the current
4 file is being rendered inverted, then any subfiles of the current file are
4 also rendered as inverted.

# Fine.

4 INVERTNEXT
4 This option is used directly before a subfile command (linetype 1).  It is
4 a flag, indicating to the renderer that the subfile reference should
4 have its orientation inverted, i.e. the inside/outside definition should be
4 swapped.  Inverted subfiles must be preceeded by a 0 BFC INVERTNEXT statement,
4 and the 0 BFC INVERTNEXT statement may not appear anywhere else in a file.
9 The INVERTNEXT flag applies *only* to the one subfile which immediately
9 follows.  Any subfile commands afterward are processed normally.

# I'll try a complete reformulation:

4 INVERTNEXT
J This option is used to swap the definitions of "inside" and "outside" (i.e.
J from which side the polygons can be seen) of a single subfile.
J This option can only be used on a line immediately preceeding a line with a
J subfile command (linetype 1), and it only influences that single subfile
J reference.
J Specifically, the sign of the determinant of the orientation matrix should
J not be considered, when a rendering program determines if a subfile is
J turned inside-out.

# Is it clear this way?

9 Rendering Engine Guidelines
--------------------------------------------------------------------------------
9 This section gives some suggestions for the design of rendering programs,
3 in order to achieve correct renderings.  Any program may violate
9 these guidelines, if there is another way to acheive a valid rendering.

# Fine.

Matrix Inversions.  Rendering engines will need to correct for transformation
1 matrices which inadvertently invert a subfile.  They will also need to
1 allow for situations in which the matrix is deliberately given a negative
1 determinant, in order to mirror the subfile.

# I suppose that the meaning of this statement is that the
# (C)CW-ness of the polygons is compensated for the
# determinant of the accumulated orientation matrix, but it
# is not very clear.

It's not very clear, because I was trying to avoid telling people specifically
how to code their programs.  It might make sense to write a sample program to
illustrate these hard-to-explain points.

# I tried to add a bit of clarification with the INVERTNEXT
# text. Maybe that is enough.

Try this:
  Matrix Inversions.  Rendering engines will need to correct for transformation
1 matrices which inadvertently invert a subfile.  They will also need to
1 allow for situations in which the matrix is deliberately given a negative
9 determinant, in order to mirror the subfile.
9
9 The typical method of determining that the file has been manually inverted is
9 to calculate the determinate of the transformation matrix.  If the determinate
9 is negative, then the subfile has been inverted.  This document does not
9 attempt to address the details of 3D graphics algorithms and issues.

# %s/determinate/determinant/g ?

9
9 The typical way to adjust for matrix inversions is to switch the winding of
9 the polygon vertices.  That is, if the DAT specifies the winding as CW, and
9 the current subfile has been inverted, the rendering program would proceed as
9 if the winding is CCW.

# I am not sure this actually clarifies things more. See if
# the text with the INVERTNEXT is enough.

7 If 32 <= Color And Color <= 47 Then // This restriction may or may not be
7    AccumClip = FALSE                // required, depending on the style of
7 End If                              // rendering for transparent surfaces.

# Shouldn't the check on colour numbers rather be formulated
# "If Transparent (Colour) Then"? We should remember that
# people can redefine the meaning of the colour numbers, so
# other numbers than the range 32 to 47 can refer to
# transparent colours.

Good idea.  But that entire test belongs in the BFC() function.

# Yes.

I changed every occurrence of Color to Colour.  Any other American-isms which
need to be changed to Australia-isms?

# Didn't notice any.

I changed it to:

9    If Command.LineType != BFC Then
4       InvertNext = FALSE
9    ElseIf No Option in Command is INVERTNEXT Then
9       InvertNext = FALSE
4    End If

... to avoid any problems with evaluating tests in compound boolean expressions.

# Probably better, even though the "or else" is very clear
# (for Ada programmers ;-).
--------------------------------------------------------------------------------

Play well,

Jacob

------------------------------------------------------------
--  E-mail:               sparre@cats.nbi.dk              --
--  Web...:  <URL: http://hugin.ldraw.org/LEGO/Biler/ >   --
------------------------------------------------------------



Message has 1 Reply:
  Re: Line in the Sand
 
(...) I like your explanation better, but I think we're both missing the point: this paragraph is supposed to be about INVERTNEXT, not inversion. Fewer details are appropriate at this point. More details should go in (1) the explanation of inversion (...) (24 years ago, 15-Dec-99, to lugnet.cad.dev)

Message is in Reply To:
  Re: Line in the Sand
 
(...) It's an admin role vs. personal role thing. I took it upon myself to write up a spec, I didn't want to imply that it was endorsed by the group at large. (...) Hmmm. You're right. Inversion is no more global than accumulated clipping. They are (...) (24 years ago, 14-Dec-99, to lugnet.cad.dev)

85 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