I'm not sure I see what the problem is - if all the trimesh data is
stored in memoryblocks, then the data is easily shared. When
creating a cloned trimesh make a copy of the memoryblocks
containing the vertex positions, and normals (and keep those copies
in the clone) but use pointers to the original UV's and triangle
indices (etc).
There is no problem so far. I just want to make sure this is the best
way to go.
I don't know how you're creating trimeshes though - you really need
to make them from scratch to ensure the data is yours and not just
a copy you got from Quesa.
I'm working on this part right now. I'm still trying to learn how to
use the Quesa Wrappers.
Here's what I have so far. I'm basically just trying to clone the
Object.
//GetTriMesh returns the pointers to all the Trimeshes
dim dis as DisplayGroup3D
dim t,t2 as Trimesh3D
Dim tmshes(0),i,c as integer, mem as MemoryBlock
GetTriMesh(GetShapeHandle(mShape),tmshes)
dis=new DisplayGroup3D
c=UBound(tmshes)
for i=1 to c
t=new Trimesh3D(tmshes(i))
mem=t.GetData
t2=new Trimesh3D(mem)
dis.AddObject t2
next
Addshapefromhandle dis.GetHandle
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|