; ID: 322 ; Author: carcrash ; Date: 2002-05-16 17:38:47 ; Title: mesh reassembler ; Description: Put multiple meshes back together easily Graphics3D 1024,768,16,0 ;ever have a hard time reassembling multiple meshes in blitz? this makes it easy ;write down your part offsets then position entity them as child meshes of the main object ;useful to reassemble .3ds or .x models made of multiple meshes rotate them 1st in 3dsmax ;finds the offsets you need to move each part ;written by chrisian anderson aka carcrash freeman@dimensional.com www.gothlust.com SetBuffer BackBuffer() move# = 0.005 ;change to whatever move amount you want Global ScaleMeshfactor# = 0.06 ;adjust as needed Global zoomfactor# = 1.01 ;adjust as needed zoom is lost when you change views ;put parts in order that you want to add them so if c gets atttached to b and b to a load a b c ;load your parts here hit f1 after moving 2nd part to 1st to start moving 3rd part etc ;supports an infinite number of parts ;all parts beyond the 1st 2 are hidden until you are ready to start placing them ;zoom and pans are lost when you change camera views ; LOAD MESHES HERE all info on how to actually run the program is in the display createpart("tank_1.3ds") ;1st part base object createpart("turret_1.3ds") createpart("turret_1.3ds") ;dont change anything below here Type partstype Field s Field name$ Field x# Field y# Field z# Field size# Field rotation Field partnumber End Type Global cx# ;hold camera loc Global cy# Global cz# Global rx# ;hold camera rotation Global ry# Global rz# camera=CreateCamera () light=CreateLight() Global cameracycle=0 Global cameraswitchtimer Global zoomtimer = MilliSecs() PositionEntity camera,10.0,0.0,0.0 RotateEntity camera,0.0,90.0,0.0,1 cx# = 10.0 cy# = 0.0 cz# = 0.0 rx# = 0.0 ry# = 90.0 rz# = 0.0 Global partcount = 0 Function createpart (part_name$) part.partstype = New partstype part\s = LoadMesh(part_name$) If partcount > 0 Then HideEntity part\s ScaleMesh part\s,scalemeshfactor#,scalemeshfactor#,scalemeshfactor# part\name$ = part_name$ part\x# = 0.0 part\y# = 0.0 part\z# = 0.0 part\size# = scalemeshfactor# part\partnumber = partcount partcount = partcount + 1 PositionEntity part\s,part\x#,part\y#,part\z# End Function For part.partstype = Each partstype If part\partnumber > 0 ShowEntity part\s While Not KeyDown(1) If KeyDown(59) part = After part ShowEntity part\s ;wait one sec before loading next part cameraswitchtimer = MilliSecs() + 1000 Repeat cameraswitchtimer = cameraswitchtimer Until cameraswitchtimer < MilliSecs() EndIf If KeyDown(60) And zoomtimer