how do i do this

Blitz3D Forums/Blitz3D Programming/how do i do this

D4NM4N(Posted 2005) [#1]
i want to copy a mesh and then alter the vertex coords of said mesh. Copyentity alters only the host mesh, an copymesh creates a virgin copy of the mesh. I need to match the scale of the original to the copy dynamically. Is there a way of reading the size of a mesh after using scaleentity??

meshwidth only seems to return the original values.


Stevie G(Posted 2005) [#2]
Other than actually storing the entity scale for later use ..

You could use your own function to do this. Will obviously be slower but if you iterate through the vertices in the original mesh, create a new mesh. The good news is that tformpoint will take into consideration the entity scale.

Assume mesh is the original mesh, entity is the scaled version of this mesh and newmesh is the new scaled version of mesh

Get the new vertices like so ( not tested as at work )....

newmesh = copymesh( mesh )
s=getsurface( mesh , 1 )
ns = getsurface( newmesh )

for v = 0 to countvertices( mesh ) - 1
  tformpoint vertexx( s, v ), vertexy( s, v ), vertexz( s, v ), Entity , 0
  vertexcoords ns , v, tformedx(), tformedy(), tformedz()
next


Hope this helps .. at least it'd point you in the right direction.


D4NM4N(Posted 2005) [#3]
thats a good idea thx