Subject:
|
Matrix mirroring question
|
Newsgroups:
|
lugnet.cad.dev
|
Date:
|
Wed, 21 Jan 2004 04:47:12 GMT
|
Viewed:
|
1674 times
|
| |
| |
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.
--Travis Cobbs
|
|
Message has 1 Reply: | | Re: Matrix mirroring question
|
| (...) 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 (...) (21 years ago, 27-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
|
|
|
|