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 / 9468
9467  |  9469
Subject: 
Re: Matrix mirroring question
Newsgroups: 
lugnet.cad.dev
Date: 
Tue, 27 Jan 2004 00:08:04 GMT
Viewed: 
3614 times
  
In lugnet.cad.dev, Travis Cobbs wrote:
> This question is mostly directed a developers that have had to deal with
> mirroring while processing LDraw files, but I welcome comments from anyone.
> 
> It seems to me that any model specified with a mirror matrix will be mirrored
> relative to its parent model.  So each mirror matrix would switch a "mirrored"
> bit, no matter what the mirror matrix is.  For example, a mirrored part that
> makes a mirrored reference to a stud file would always result in an un-mirrored
> stud, no matter what matrices were used to mirror the part and the stud.
> 
> However, while it seems that this should be the case, I'm not 100% positive it
> is true for all possible mirror matrix combinations.  I would have thought so,
> but I remember specifically that I originally assumed this when I implemented my
> stud mirror detection code, and then changed my code later for some reason.  I
> no longer remember why I changed the code, but I can't shake the feeling that I
> ran into a case where it didn't work right.
> 
> Note that among other things, the same mirror detection is necessary for proper
> BFC handling.  So I'm hoping someone who has already implemented BFC
> handling--or dealt with polygon winding vs normal direction outside the
> constraints of BFC--can give me a definitive answer.
> 
> Note that LDView currently skirts the entire issue by copying repeating elements
> in the model tree, and calculating the surface normals after it already knows
> the final matrix state for a each surface.  It also decides whether studs are
> mirrored after they have been copied, and their final matrix relative to the
> model's base coordinate system is known.  This sucks up a lot of memory, and
> increases load times, but seemed at the time it was written to improve
> performance.  I'm no longer sure this is the case, but it's way to late to go
> back and fix it in the existing code-base.  I am, however, working on the next
> major version of LDView with an entirely new back-end, and won't be repeating
> this design.

Since det(AB)=det(A)det(B) I don't think it matters whether you check the determinant
(mirroring) at each level or the final level.
Too bad you didn't add a comment in your old code :-)
I often beat myself for not adding more elaborate comments.
While things may seem obvious while you're working on them,
you have forgotten all the good arguments when you get back a year later...
/Lars



Message has 1 Reply:
  Re: Matrix mirroring question
 
(...) Thanks. I implemented it that way, and it seems to be working so far, so I believe that everything is fine. (...) You're too right. Unfortunately, I can go for a while and do a really good job of commenting, and then I'll slack off for one (...) (23 years ago, 29-Jan-04, to lugnet.cad.dev)

Message is in Reply To:
  Matrix mirroring question
 
This question is mostly directed a developers that have had to deal with mirroring while processing LDraw files, but I welcome comments from anyone. It seems to me that any model specified with a mirror matrix will be mirrored relative to its parent (...) (23 years ago, 21-Jan-04, to lugnet.cad.dev)

3 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
    

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