Special:
|
[DAT] (requires LDraw-compatible viewer)
|
Subject:
|
Re: Quick way to mirror-image a model?
|
Newsgroups:
|
lugnet.cad
|
Date:
|
Fri, 18 Jun 2004 19:59:25 GMT
|
Viewed:
|
3427 times
|
| |
| |
In lugnet.cad, Don Heyse wrote:
> Here's what I'm talking about. Completely ripped off from the
> MLcad.ini file.
>
> http://ldglite.sf.net/mirror.ini
>
> That one contains an entry every part in my parts.lst file. It
> needs to have the changes made for the exceptions, but here's
> how it starts. [...]
> 2546.DAT 2546.DAT 0 1 0 0 0 1 0 0 0 1 0 0 0
> 2546P01.DAT 2546P01.DAT 0 1 0 0 0 1 0 0 0 1 0 0 0
> 6029A.DAT 6029A.DAT 0 1 0 0 0 1 0 0 0 1 0 0 0
I think I've got a more general solution, but first a quick thought: You could
make mirror.ini more human-readable if the 'normal' parts were just flagged.
Something like:
2546.DAT default
41770.DAT exception 41769.DAT 0 1 0 0 0 1 0 0 0 1 0 0 0
On to the weird stuff, apologies if the following covers ground already
discussed.
It seems like mirror.ini will work for the basic case, where parts are not
rotated (or only rotated by 90 degree increments around the Y-axis). But what
about exception parts at arbitrary orientations? I'm not very good at thinking
in terms of matrix math, so I worked through a concrete example.
I used the 2x4 wings, 41770 and 41769. I mirrored along the X axis (my
mistake), but I'll get back to Z axis mirroring in a bit. The 41770's
X-axis-style entry in MIRROR.INI would be like:
41770.DAT 41769.DAT 0 -1 0 0 0 1 0 0 0 1 0 0 0
So I put a 41770 in a model file and postioned it like this:
1 4 130 -70 -130 .39 -.64 -.66 .6 .72 -.34 .7 -.27 .66 41770.dat
Then I tried to mirror it cleanly. That is, I wanted to end up with 41769 in
the position/orientation corresponding to my 41770, which means that its final
transformation matrix would be 'non-mirroring'. What I ended up with is this
LDLite language:
0 TRANSFORM 0 0 0 -1 0 0 0 1 0 0 0 1
0 TRANSFORM 130 -70 -130 .39 -.64 -.66 .6 .72 -.34 .7 -.27 .66
1 3 0 0 0 -1 0 0 0 1 0 0 0 1 41769.dat
0 TRANSFORM END
0 TRANSFORM END
Translated back to simple LDraw, this code turns into:
1 3 -130 -70 -130 .39 .64 .66 -.6 .72 -.34 -.7 -.27 .66 41769.dat
Getting back to mirroring along the Z axis: I figured out that the correct
equivalent Z axis mirror operation looks like this:
0 TRANSFORM 0 0 0 1 0 0 0 1 0 0 0 -1
0 TRANSFORM 130 -70 -130 .39 -.64 -.66 .6 .72 -.34 .7 -.27 .66
1 3 0 0 0 -1 0 0 0 1 0 0 0 1 41769.dat
0 TRANSFORM END
0 TRANSFORM END
What's interesting is the pre-mirrored part (41769) is inlined with the same transformation as before (-1 0 0 0 1 0 0 0 1). I expected that I'd have to rotate 41769 180 degrees, and then reposition it, to make things work.
After thinking about it, I think what happened is this: instead of trying to map 41770 to 41769 in some way that is equivalent to a mirroring operation, I actually replaced the original part with an already-mirrored equivalent statement. That is, I replaced the '41770.dat' in the first statement with '1 16 0 0 0 -1 0 0 0 1 0 0 0 1 41769.dat', like an inlined subfile. Since this part was pre-mirrored, applying the mirroring transformation actually 'un-mirrored' the 41769.
So, to make a long story short - I don't think MIRROR.INI should specify how to
transform part A into part B without a mirror operation. It should specify the
opposite: how to mirror part B into part A with a mirroring operation, so
mirroring-programs can take the transformation being used on part A in the model
file and wrap it around the mirrored part B.
The main practical effect on MIRROR.INI would be that normal parts would have a mirroring transform (1 0 0 0 1 0 0 0 -1) instead of the standard transform.
Steve
|
|
Message has 2 Replies: | | Re: Quick way to mirror-image a model?
|
| (...) Actually I was thinking of deleting them from the file to make it smaller. The only problem is remembering which ones were deleted and which ones are new at update time. I'm not sure how to automate additions either way. Probably have to use (...) (20 years ago, 18-Jun-04, to lugnet.cad)
|
Message is in Reply To:
| | Re: Quick way to mirror-image a model?
|
| (...) Talking to myself... Here's what I'm talking about. Completely ripped off from the MLcad.ini file. (URL) one contains an entry every part in my parts.lst file. It needs to have the changes made for the exceptions, but here's how it starts. ; ; (...) (20 years ago, 18-Jun-04, to lugnet.cad)
|
65 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
|
|
|
|