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 / 9024
     
   
Subject: 
Re: Mirrored parts and studs
Newsgroups: 
lugnet.cad.dev
Date: 
Tue, 1 Jul 2003 21:38:12 GMT
Viewed: 
1332 times
  

Orion Pobursky wrote:

1.)  Nothing is wrong with the part.  The stud logos are added by an external
program and are not part of the DAT code.  This is, therefore, a limitation of
the external program and not of the part itself.

2.)  The part itself is flawed in that the studs are mirrored.  We should redo
all the mirrored parts with stud in such a way that the studs are not mirrored.

My view is that there is nothing _serious_ wrong, but that a fix should
be welcome.

Anyway.  Since we are only talking about studs, the rendering programs
_could_ simply remember to fix any mirrored studs (can be done by
multiplying the rotation matrix of the object with the sign of its
determinant).

Play well,

Jacob
--
Horse (building instructions):
                        http://jacob.sparre.dk/LEGO/Dyr/Hest/

   
         
   
Subject: 
Re: Mirrored parts and studs
Newsgroups: 
lugnet.cad.dev
Date: 
Wed, 2 Jul 2003 13:23:49 GMT
Viewed: 
1386 times
  

In lugnet.cad.dev, Jacob Sparre Andersen wrote:
Anyway.  Since we are only talking about studs, the rendering programs
_could_ simply remember to fix any mirrored studs (can be done by
multiplying the rotation matrix of the object with the sign of its
determinant).

Umm, my math is really rusty.  Can the sign of the determinant also
be used to detect mirroring?  That could be handy.

Don

   
         
   
Subject: 
Re: Mirrored parts and studs
Newsgroups: 
lugnet.cad.dev
Date: 
Wed, 2 Jul 2003 16:53:15 GMT
Viewed: 
1558 times
  

In lugnet.cad.dev, Don Heyse wrote:
In lugnet.cad.dev, Jacob Sparre Andersen wrote:
Anyway.  Since we are only talking about studs, the rendering programs
_could_ simply remember to fix any mirrored studs (can be done by
multiplying the rotation matrix of the object with the sign of its
determinant).

Umm, my math is really rusty.  Can the sign of the determinant also
be used to detect mirroring?  That could be handy.

Yes.  That's what LDView does.

--Travis Cobbs

   
         
   
Subject: 
Re: Mirrored parts and studs
Newsgroups: 
lugnet.cad.dev
Date: 
Wed, 2 Jul 2003 18:12:02 GMT
Viewed: 
1597 times
  

In lugnet.cad.dev, Travis Cobbs wrote:
In lugnet.cad.dev, Don Heyse wrote:
In lugnet.cad.dev, Jacob Sparre Andersen wrote:
Anyway.  Since we are only talking about studs, the rendering programs
_could_ simply remember to fix any mirrored studs (can be done by
multiplying the rotation matrix of the object with the sign of its
determinant).

Umm, my math is really rusty.  Can the sign of the determinant also
be used to detect mirroring?  That could be handy.

Yes.  That's what LDView does.

Yeah, I did a search for determinant and found your note.  I tried
the on-the-fly fix in ldglite with the L3 structs and it seems to work,
although I'm not sure I'm applying the fix correctly.  Is it really
as simple as multiplying some matrix by -1?  I must have been applying
the -1 to the wrong matrix, so I went with mirror around the Z axis
transform instead.  Can you point me to the ldview code that does this?
I'm feeling rather lazy today, asking for help before looking for
myself...

Thanks,

Don

   
         
   
Subject: 
Re: Mirrored parts and studs
Newsgroups: 
lugnet.cad.dev
Date: 
Wed, 2 Jul 2003 18:54:17 GMT
Viewed: 
1647 times
  

In lugnet.cad.dev, Don Heyse wrote:
Yeah, I did a search for determinant and found your note.  I tried
the on-the-fly fix in ldglite with the L3 structs and it seems to work,
although I'm not sure I'm applying the fix correctly.  Is it really
as simple as multiplying some matrix by -1?  I must have been applying
the -1 to the wrong matrix, so I went with mirror around the Z axis
transform instead.  Can you point me to the ldview code that does this?
I'm feeling rather lazy today, asking for help before looking for
myself...

I don't actually do any transformations in LDView to get the logos right.  I
just detect the mirroring (by tracking negative determinants and flipping the
mirrored bit every time I see one) and modify my texture coordinates to
un-mirror (horizontally) if the stud has been mirrored.  You can take a look at
the genTextureCoords method in TGLStudLogo.cpp if your interested, but I don't
think it will really help you.

--Travis

   
         
   
Subject: 
Re: Mirrored parts and studs
Newsgroups: 
lugnet.cad.dev
Date: 
Wed, 2 Jul 2003 19:14:19 GMT
Viewed: 
1732 times
  

In lugnet.cad.dev, Travis Cobbs wrote:
I don't actually do any transformations in LDView to get the logos
right.  I just detect the mirroring (by tracking negative
determinants and flipping the mirrored bit every time I see one) and
modify my texture coordinates to un-mirror (horizontally) if the
stud has been mirrored.  You can take a look at the genTextureCoords
method in TGLStudLogo.cpp if your interested, but I don't think it
will really help you.

Actually that does help a bit.  It looks like you aren't concerned
with whether the logo faces the same direction as on the actual part,
you're just ensuring that it's readable.  That makes me feel better
about my solution.

By the way, why do you bother to track all the mirroring steps?  Can't
you just look at the final matrix?

Don

   
         
   
Subject: 
Re: Mirrored parts and studs
Newsgroups: 
lugnet.cad.dev
Date: 
Wed, 2 Jul 2003 20:18:40 GMT
Viewed: 
1710 times
  

In lugnet.cad.dev, Don Heyse wrote:
Actually that does help a bit.  It looks like you aren't concerned
with whether the logo faces the same direction as on the actual part,
you're just ensuring that it's readable.  That makes me feel better
about my solution.

Correct.  There's no way to know if they actually face the right direction, so I
just figured that horizontal mirroring was more likely to be correct than
vertical (although I could be wrong).


By the way, why do you bother to track all the mirroring steps?  Can't
you just look at the final matrix?

You can, but my code that decides which texture coordinates to use doesn't have
access to the final matrix.  Also, I flatten the geometry of all parts in
LDView, and the flattening process can result in a mirror transformation being
aplied to the stud geometry.  (By flatten, I mean that I apply the
transformations for sub-parts, and copy the geometry into the parent part.)  I
have to track when this happens.

--Travis

 

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