ok, here's a good puzzle for you...
I have two lego pieces . (shown below). I need them to snap together.

The red pieces snap together (the red dot is the parent of each piece, and the cube is the child). So far I have been successful in getting piece a to interpolate to piece b.
The problem is that once the red dots have snapped together, I need the rest of the cube to be rotated correctly, so that it's a "mirror" of cube b.
This means that the blue dots have to line up also.
My code is going to take up a lot of space and may not be neccessary to read, but I'll post it anyway:
I have two lego pieces . (shown below). I need them to snap together.

The red pieces snap together (the red dot is the parent of each piece, and the cube is the child). So far I have been successful in getting piece a to interpolate to piece b.
The problem is that once the red dots have snapped together, I need the rest of the cube to be rotated correctly, so that it's a "mirror" of cube b.
This means that the blue dots have to line up also.
My code is going to take up a lot of space and may not be neccessary to read, but I'll post it anyway:
;align the centerpivot with the center the user has selected align(p\centerpivot,p\center,0) EntityParent p\centerpivot,0 EntityParent p\mesh,p\centerpivot EntityType(p\centerpivot,0);set collision to zero for warp ;destcenter is destination center. Local ax#=EntityX(destcenter,True) Local ay#=EntityY(destcenter,True) Local az#=EntityZ(destcenter,True) axx#=EntityPitch(destcenter,True) ayy#=EntityYaw(destcenter,True) azz#=EntityRoll(destcenter,True) ;interpolate the cube piece into its position ; If ax > EntityX(p\centerpivot) Then difx = 1 Else difx = -1 End If ; If ay > EntityY(p\centerpivot) Then dify = 1 Else dify = -1 End If ; If az > EntityZ(p\centerpivot) Then difz = 1 Else difz = -1 End If ;get the rawdistance between the points distx# = (ax-EntityX(p\centerpivot)) disty# = (ay-EntityY(p\centerpivot)) distz# = (az-EntityZ(p\centerpivot)) ;get the rawrotation between the points Local rotix# = (axx-EntityPitch(p\centerpivot)) Local rotiy# = (ayy-EntityYaw(p\centerpivot)) Local rotiz# = (azz-EntityRoll(p\centerpivot)) ;divide up the distance to be traveled into increments on each axis. Local timeslice =25 incx# = distx/timeslice incy# = disty/timeslice incz# = distz/timeslice incix# = rotix/timeslice inciy# = rotiy/timeslice inciz# = rotiz/timeslice Local counter=0 While counter < timeslice PositionEntity p\centerpivot, EntityX(p\centerpivot)+incx*1, EntityY(p\centerpivot)+incy*1,EntityZ(p\centerpivot)+incz*1, True RotateEntity p\centerpivot, EntityPitch(p\centerpivot)+incix,EntityYaw(p\centerpivot)+inciy, EntityRoll(p\centerpivot)+inciz, True RenderWorld Flip counter = counter + 1 Wend RotateEntity p\centerpivot,axx,ayy,azz,True ;at this point, the red dots are perfectly aligned "on top" of each other ;now here's the problem...how do I get the blue dots to align?