realbasic-games
[Top] [All Lists]

Re: 3D animation

To: REALbasic Games <realbasic-games at lists dot realsoftware dot com>
Subject: Re: 3D animation
From: Joe Raffanti <joeraffanti at accessbee dot com>
Date: Mon, 28 Feb 2005 10:30:36 -0800
Delivered-to: realbasic-games at lists dot realsoftware dot com
References: <a06100500be427a6417fa at [66 dot 81 dot 42 dot 209]> <a06200703be42f0cd575e at [10 dot 10 dot 13 dot 4]> <a06100500be45a575a125 at [66 dot 81 dot 53 dot 45]> <a06200703be47d8831349 at [10 dot 10 dot 13 dot 4]>
Also, could you please give me a very simple example of how to use declares (or however) to open up an obect3D (maybe as a TriMesh?) and read/edit vertex positions?

There's no example simpler than the "Mesh Deformation" article in RB Developer. Check that out, it really is the best way to start. You can download the sample project from the RBD web site right away, and start poking at it while you wait for the back-issue to arrive.


Ok, it turned out that the part of the examples which was confusing me was the memoryblocks, not the trimesh code, but I have sorted that out thanks to Matt Neuburg's book and trimesh examples in "Mesh Deformation" and on the RB CD.

That was the harder part of the problem; I coded the actual MorphMap class without too much difficulty after figuring out how memoryblocks work.

So now I have a functional class, MorphMap, which has two methods (not including one which extracts a trimesh from an object 3D). The first method, a constructor, asks for two object 3D's, and compares their verticies, storing the differences in an array. The next method, ApplyMorph, asks for an object3D and a percentage as an integer. This method moves the verticies in the object3D a particular distance according the stored offsets for each point and the percentage.

This works well, and I have tested it a few times with a 3D model on a timer. The animation is smooth and does what I would expect. I have written some notes included in the class which tell how to use it and give examples.

If anyone would like a copy of this class, contact me off list (I haven't been able to get it on the internet yet).

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