mesh copy/clone q

Blitz3D Forums/Blitz3D Programming/mesh copy/clone q

markcw(Posted 2006) [#1]
hmm, i'm a bit stuck on this.

say i create a mesh like for example, a particle system, using one mesh. say i want to copy that mesh so that it is the exact same vertex-morphed mesh ie. all same vertex positions. how can you do that? do you have to copy it every time/frame it changes, like copyentity, or is there a way to copy it just once and have it update automatically??


b32(Posted 2006) [#2]
You could loop through all the vertices and use VertexCoords to move them to the same location as their original. Ie:
newmesh = copymesh(orgmesh)
for i = 1 to countsurfaces(orgmesh)
  surf = GetSurface(orgmesh, i)
  surf2 = GetSurface(newmesh, i)
  for j = 0 to countvertices(surf) - 1
    vertexcoords surf2, j, vertexx(surf, j), vertexy(surf, j), vertexz(surf, j)
  next
next

Another way is to render the mesh in a few passes: render -> new position ->render again, to make it look like there is two meshes.


markcw(Posted 2006) [#3]
thanks, but what i meant is can you make a copy of a mesh where the vertices are like childed/controlled by the parent mesh? does copyentity, or anything else, do this? i'm a bit lazy to find out myself.

the point is if you can do that you don't have to position as many vertices so it would allow you to use more particles at a good fps.


Matty(Posted 2006) [#4]
If you use copyentity then any changes to the original mesh will affect all copies.

If you use copymesh then any changes to the original mesh will have no effect on the copies.


markcw(Posted 2006) [#5]
thanks, i think that means i can use copyentity to do this then.