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: Lo Saeteurn <realbasic at miensoftware dot com>
Date: Sun, 24 Jul 2005 16:00:05 -0700
Delivered-to: realbasic-games at lists dot realsoftware dot com
References: <FF3D4383-F5B1-4405-A67F-BDF52954811A at miensoftware dot com> <D52AC133-DDD0-4558-8725-9508D39F6E79 at chaoticbox dot com> <F29BF550-E17D-4DD4-B907-AD971BCB8823 at miensoftware dot com> <8F479F6E-AC0F-4117-8F81-68A68C3A43E1 at chaoticbox dot com>
I'm not sure I see what the problem is - if all the trimesh data is stored in memoryblocks, then the data is easily shared. When creating a cloned trimesh make a copy of the memoryblocks containing the vertex positions, and normals (and keep those copies in the clone) but use pointers to the original UV's and triangle indices (etc).

There is no problem so far. I just want to make sure this is the best way to go.

I don't know how you're creating trimeshes though - you really need to make them from scratch to ensure the data is yours and not just a copy you got from Quesa.

I'm working on this part right now. I'm still trying to learn how to use the Quesa Wrappers.


Here's what I have so far. I'm basically just trying to clone the Object.
//GetTriMesh returns the pointers to all the Trimeshes
  dim dis as DisplayGroup3D
  dim t,t2 as Trimesh3D
  Dim tmshes(0),i,c as integer, mem as MemoryBlock

  GetTriMesh(GetShapeHandle(mShape),tmshes)
  dis=new DisplayGroup3D

  c=UBound(tmshes)
  for i=1 to c
    t=new Trimesh3D(tmshes(i))
    mem=t.GetData
    t2=new Trimesh3D(mem)
    dis.AddObject t2
  next

Addshapefromhandle  dis.GetHandle

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