Code archives/3D Graphics - Mesh/MeshExpand()

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

Download source code

MeshExpand() by Litobyte2002
Function MeshExpand(mesh,omesh,am#)
Needs a backup [omesh] of the mesh to "blow" [mesh] created before to launch the function.

am# is the expansion ratio.
;***code by halo
Function MeshExpand(mesh,omesh,am#)

For k=1 To CountSurfaces(mesh) 
	surf=GetSurface(mesh,k) 
	surf2=GetSurface(omesh,k) 
	For index=0 To CountVertices(surf)-1 
		newx#=VertexX(surf2,index)+VertexNX(surf2,index)*am 
		newy#=VertexY(surf2,index)+VertexNY(surf2,index)*am 
		newz#=VertexZ(surf2,index)+VertexNZ(surf2,index)*am 
		VertexCoords surf,index,newx,newy,newz 
	Next 
Next 

End Function

Comments

None.

Code Archives Forum