On Nov 8, 2005, at 11:06 AM, Joseph J. Strout wrote:
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).
Ah, I knew there had to be a way.
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.
Duh, parent-child not peers, get it!
Thanks!
--
Joseph Nastasi
Pyramid Design - a software development firm
http://www.pyramiddesign.us
Voice 609 601-0814 Fax 609 601-0815
Products:
A-OK! Spacecraft Simulation System - http://aok.pyramiddesign.us
A-OK! The Wings of Mercury http://www.aokwom.com
FTP Suite for REALbasic - http://ftpsuite.pyramiddesign.us
Columnist for REALbasic Developer Magazine
Proud Sponsors of REALbasic Olympics 2005
_______________________________________________
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>
|