At 10:40 AM -0500 11/8/05, Joseph Nastasi wrote:
So, I built a trimesh that I need to replicate. Can I clone it?
Yes, though it takes a few steps. Each of the group accessor classes
(VectorList, TriangleList, and so on) has a Copy method. So, to
clone a TriMesh, you would make a new TriMesh, set its number of
vertices and triangles and such to the same as your original, and
then call Copy on the VertexPositions, VertexNormals, Triangles,
VertexColors (if applicable), and VertexUVs (ditto).
I tried to cast the trimesh as an Object3D and use the clone
method, but it said the cast was illegal.
That's right. Object3D and TriMesh both derive from Element3D; they are peers.
Best,
- Joe
--
Joe Strout REAL Software, Inc.
Vote for REALbasic (twice!) in the LinuxWorld Reader's Choice Awards:
http://linux.sys-con.com/general/readerschoice.htm
_______________________________________________
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>
|