On Nov 8, 2005, at 2:03 PM, Joseph J. Strout wrote:
Probably all that time is going into this line:
clone.Material.Texture = original.Material.Texture
...which converts the internal texture into a Picture (on the
right-hand side), and then converts a Picture into an internal texture
(on the left-hand side). These are very expensive operations.
But I think you should be able to share the texture, like so:
clone.Material = original.Material
which means you don't have a fully separate clone; a change to the
material in one place would affect it in the other. But it sounds
like that is fine for your purposes, and would be much faster.
That's okay. The texture is the same, just the UVs change for each
clone. And it works and it IS faster loading for, now obvious, reasons.
Also... if you really do want to have the same object appearing
multiple times in the scene, all with the same texture, then you'd be
better off not using TriMesh at all, but using Object3D, which you
could load once and then .Clone it (which really does share all the
geometry data, unlike our trimesh cloning here). Is there some reason
you can't do that -- the image not being available until runtime,
perhaps?
It's to create an LCD display and there's no way of knowing the size or
the texture to be used in advance. Also, this depends on using the UV
to "select" a character from a strip of characters, so Object3D
wouldn't work.
If so, we may be able to hack something out using
Object3D.AddShapeHandle, given the Trimesh handle -- I don't have the
code or docs handy at the moment, so I can't be sure this is
supported, but it might be. Let me know where you are and we'll keep
working on it.
No, that looks fine. It was the loading that was killing be and
obviously I needed to share the image rather than reloading.
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>
|