Hi Egon.
Thought I would post here as a general query.
Within my application I (can) re-use an object, such as a cube or arrow, many times... To save re-creation, memory and time I load each object type that is required into a HashMap with a name (like CUBE1) - if the same object is needed again, it is got from the Map and a new Object3D created from it via the Object3D( 'object_a' ) constructor (which I believe clones the original object).
This process also clones the textures assigned to object 'a' on object 'b' - which is fine except I want a different texture on object 'b' than 'a'. I set object 'b's texture to my newly required texture through obj.setTexture(), but it just <i>adds</i> a reference to the new texture, compared to replacing it. This would be fine, but I cannot remove/ change the reference to the original texture, therefore object 'b' now has two textures.
How can I re-use an object many times, whilst minimising replication, but keep changing the texture - is there a way of doing obj.removeTexture(), obj.deleteTexture() or obj.replaceTexture() ?
Many thanks...