To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cadOpen lugnet.cad in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / 11596
11595  |  11597
Subject: 
Re: Quick way to mirror-image a model?
Newsgroups: 
lugnet.cad
Date: 
Fri, 18 Jun 2004 16:24:38 GMT
Viewed: 
3176 times
  
n lugnet.cad, Carl Nelson wrote:
The true proper thing to do is to adjust the rotation matrix of all
parts by

            -a  d -g
(x, y, z) * -b  e -h = (-ax-by-cz, dx+ey+fz, -gx-hy-iz)
            -c  f -i

and create a list of exceptions that would be a rotation matrix plus
a translation, for example a 2 x 2 corner reflected on a horizontal
axis should be rotated by:

0  0 -1
0  1  0
-1  0  0

giving (x' = -z, y' = y, z' = -x)

and then translated in X and Z axes to put it in the right place.

Basically that would mean that any part having a rotation point not
at its geometric center would need a custom rotation and
translation.

Sadly, I can't help you with the formal matrix rotation or linear
algebra--my understanding of all of this comes from picking at
LDraw parts until I get what I'm looking for...

Don't worry--I actually have a math degree and did most of my work
in linear algebra & analytical geometry and, um, it took far longer
to understand this than I care to admit...

The more I look at this, the more I see what Dan was saying--this
is a cumbersome method!

Ah, it's not too bad, especially when I did my program to automate
it.  It has shortcomings, but it works for the majority and the rest
is merely exception processing.

Take a peek at the MLCAD.INI file for minifig posing.  Could you
use a config file like this to handle the exceptions?  I'd imagine
if you pick one axis for mirroring that works best with most parts,
(I think Travis said most were symmetric across the Z axis?) then
you could give a rotation matrix for the exceptions to make them
line up correctly.  Then to get a mirror over another axis you
mirror over the standard axis and and apply a rotation to the
results.

It'd be really nice to create a MIRROR.INI file, put it in the ldraw
directory and keep it updated with the parts.  Then if you could put
some wrappers around your program to allow it to be used as an MLCAD
generator and an LDDP plugin, that'd be fantastic.

Have you considered making the source code available?

Enjoy,

Don



Message has 2 Replies:
  Re: Quick way to mirror-image a model?
 
(...) Oh yeah, the other exception would be a part substitution, like left minifig arm for right arm, or left wing plates for right wing plates. But watch out, some folks might object to substituting left-wing for right-wing of anything. ;^) (...) (20 years ago, 18-Jun-04, to lugnet.cad)
  Re: Quick way to mirror-image a model?
 
(...) Is there any documentation about what functionality needs to be exposed to make an MLCAD plugin? I've been playing with this in a class-based architecture, that has an LMirrorExceptionList that contains an array of LMirrorExceptionPart. I've (...) (20 years ago, 21-Jun-04, to lugnet.cad)

Message is in Reply To:
  Re: Quick way to mirror-image a model?
 
(...) Now that I've done that, I agree with you. The true proper thing to do is to adjust the rotation matrix of all parts by -a d -g (x, y, z) * -b e -h = (-ax-by-cz, dx+ey+fz, -gx-hy-iz) -c f -i and create a list of exceptions that would be a (...) (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
    

Custom Search

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