realbasic-games
[Top] [All Lists]

Re: Animation and memory issue

To: REALbasic Games <realbasic-games at lists dot realsoftware dot com>
Subject: Re: Animation and memory issue
From: Frank Condello <developer at chaoticbox dot com>
Date: Sun, 24 Jul 2005 04:04:24 -0400
Delivered-to: realbasic-games at lists dot realsoftware dot com
References: <FF3D4383-F5B1-4405-A67F-BDF52954811A at miensoftware dot com>
On 23-Jul-05, at 10:12 PM, Lo Saeteurn wrote:

Now I have a problem with memory. Sure it is very memory efficient when you have only 1 animation object, but the problem arises when you want to have multiple models that animate at the same time...

To solve this problem, I would have to separate the geometry and share only the textures. I have no idea how to take texture from an existing Object3D and share it with another. Also, I would need to copy just the geometry from an Object3D and add it into a new Object3D.

With declares, you should be able to do both of these in one shot by grabbing each trimesh's data with Q3TriMesh_GetData and putting a copy into a new (empty) trimesh with Q3TriMesh_SetData. IIRC, the Q3TriMesh_GetData method copies only the attributeset reference rather than duplicating it, so textures will be shared but each trimesh will have their own geometry. Keep in mind you'll have to duplicate the the whole display group hierarchy for multi-mesh models, but that's not too difficult.

You can of course share one set of keyframes between all clones, and if you want to refine it further you really only need one set of triangle indices and texture UVs for the whole lot as well. That would probably require you build the your trimeshes from scratch and/ or grab and keep that data locally in memoryblocks.

Frank.
–––––––––––––––––––––––––––––––––
Open Source RB Goodies and Shareware
<http://developer.chaoticbox.com/>
<http://www.chaoticbox.com/>
–––––––––––––––––––––––––––––––––


_______________________________________________
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>

<Prev in Thread] Current Thread [Next in Thread>