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 AuzingLG
(Posted 23 years ago)
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

Blitz123
(Posted 23 years ago)
This is absolutly bril! From Blitz123

ryan scott
(Posted 22 years ago)
what about FitMesh??

Nilium
(Posted 22 years ago)
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.

puki
(Posted 22 years ago)
Good work though "AuzingLG" - you obviously weren't aware, yet you decided to soldier on for a solution - good stuff.

DJWoodgate
(Posted 22 years ago)
I think he was well aware, his routine works.

Filax
(Posted 22 years ago)
Thanks for this function !!!! very usefull for me !

Code Archives Forum