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 / 11648
11647  |  11649
Subject: 
Re: Quick way to mirror-image a model?
Newsgroups: 
lugnet.cad, lugnet.cad.mlcad
Date: 
Wed, 23 Jun 2004 17:52:27 GMT
Viewed: 
9406 times
  
In lugnet.cad, Carl Nelson wrote:
Check how I do it in my code.  You'll probably have to fetch L3Math.c
and L3Def.h from the ldglite CVS archive on the sourceforge to see
the order, because I think I only put the new stuff in the mirwiz.zip
file.

Looks like you're doing MF = MP * (MC * ME) in the code?

Yes, that looks right.

The other thing that messes me up with LDRAW matrices is the row,
column ordering.  The ordering in LDRAW files is not what I would
have chosen, so I always have to look it up.  From the old FAQ:

  http://www.ldraw.org/OLD/community/memorial/archive/FAQ/

Line type 1's format is:

Line Format:
    1 colour x y z a b c d e f g h i part.dat

Fields a through i are orientation & scaling parameters, which can be
used in 'standard' 3D transformation matrices. Fields x, y and z also
fit into this matrix:

    | a d g 0 |
    | b e h 0 |
    | c f i 0 |
    | x y z 1 |

so that every point (x, y ,z) gets transformed to (x', y', z') :

    x' = a*x + b*y + c*z + x
    y' = d*x + e*y + f*z + y
    z' = g*x + h*y + i*z + z

or, in matrix-math style:

                                    | a d g 0 |
    | X' Y' Z' 1 | = | X Y Z 1 | x  | b e h 0 |
                                    | c f i 0 |
                                    | x y z 1 |


Now, I'm not actually sure what the row-column order is in the
MLCAD.INI file.  Since (x,y,z) was moved to last, maybe the 3x3
is laid out in rows instead of columns.  I suppose we should get
that clarified so we use the same format in the MIRROR.INI file.

Here's what MLCAD.INI says:

; <Matrix> a rotation matrix a11 a12 a13 ... a33 for optimal appearance
;          at 0 degree rotation angle
; <Offset> The offset of the part to be in place

I don't know if a12 is b, or if a21 is b. It looks like this in the file:

"Cap"    "4485.DAT"          0  1 0 0 0 1 0 0 0 1  0 0 0

Is that     a b c d e f g h i     x y z   ???

Or is it     a d g b e h c f i     x y z   ???

Don



Message has 2 Replies:
  Re: Quick way to mirror-image a model?
 
(...) Total side note: I agree with Don, row/column ordering is not what I would have chosen. BUT, it is far easier (IMO) to hand-transform row/column LDraw commands than the equivalent column/row commands (like I've had to do in POV-Ray code). (...) (20 years ago, 23-Jun-04, to lugnet.cad, lugnet.cad.mlcad)
  Re: Quick way to mirror-image a model?
 
Hi Don, now it's getting interesting ... "Don Heyse" <dheyse@hotmail.spam....away.com> schrieb im Newsbeitrag news:HzrwBF.9t2@lugnet.com... <SNIP> (...) I'm actually reading it in as | a b c | | d e f | | g h i | and that is also how I'm writing my (...) (20 years ago, 24-Jun-04, to lugnet.cad, lugnet.cad.mlcad)

Message is in Reply To:
  Re: Quick way to mirror-image a model?
 
(...) It's neither commutative [(a * b) * c != a * (b * c)] nor associative [a * b != b * a]. That shouldn't be the problem in the calculation above, since the current matrix was the identity matrix... (...) Looks like you're doing MF = MP * (MC * (...) (20 years ago, 23-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