Code archives/3D Graphics - Mesh/ResizeMesh(mesh,width#,height#,depth#)

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

Download source code

ResizeMesh(mesh,width#,height#,depth#) by AuzingLG2003
Remember the ResizeImage function. There is nothing like that for entities and meshes. My function does it with one line code.
Function ResizeMesh(mesh,width#,height#,depth#)
   
   ScaleMesh mesh,1/MeshWidth#(mesh)*width#,1/MeshHeight#(mesh)*height#,(1/MeshDepth#(mesh))*depth#

End Function

Comments

Blitz1232004
This is absolutly bril! From Blitz123


ryan scott2004
what about FitMesh??


N2004
As mentioned by ryan..

Function ResizeMesh%(M%,W#,H#,D#)
     If Mesh = 0 Then Return 0
     FitMesh M%,-W#*.5,-H#*.5,-D#*.5,W#*.5,H#*.5,D#*.5
     Return 1
End Function


This is simpler and it has a failsafe.


puki2004
Good work though "AuzingLG" - you obviously weren't aware, yet you decided to soldier on for a solution - good stuff.


DJWoodgate2004
I think he was well aware, his routine works.


Filax2004
Thanks for this function !!!! very usefull for me !


Code Archives Forum