Code archives/3D Graphics - Misc/Max Mirror

This code has been declared by its author to be Public Domain code.

Download source code

Max Mirror by Braneloc2003
Not sure exactly where the actual "mirror" glitch in export/import is, (possibly LoaderMatrix ?) but this seems to fix it. I've also noticed that .X files often have their textures reversed too...
;
;
;		Max Mirror
;
;		(c) Braneloc, Feb 2003
;			Fixes "mirror" errors with objects
;
;		Contact Details: 
;			Braneloc@mirex.demon.co.uk
;
;
Function max_mirror(mesh)
	;# for some reason, either 3D Studio Max or Blitz messes with
	;# the coordinates, textures, flips or mirrors them, whatever.  
	;# This fixes it.
	ScaleMesh mesh,1,1,-1
	FlipMesh mesh
	For s=1 To CountSurfaces(mesh)
		surf=GetSurface(mesh,s)
		For n=0 To CountVertices(surf)-1
			u#=VertexU(surf,n)
			v#=VertexV(surf,n)
			VertexTexCoords surf,n,u,1-v
		Next
	Next
End Function

Comments

None.

Code Archives Forum