Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

3D animation (Real Studio games Mailinglist archive)

Back to the thread list
Previous thread: Find Other Servers on LAN
Next thread: Setting quaternions by way of "=" or copying them


[ANN] Preview of RBD 2.4   -   Marc Zeedar
  3D animation   -   Joe Raffanti
   Re: 3D animation   -   Joe Raffanti
   Re: 3D animation   -   Joseph J. Strout
   Re: 3D animation   -   LMSpam neuropop.com
   Re: 3D animation   -   Joe Raffanti
   Re: 3D animation   -   Frank Condello
   Re: 3D animation   -   Joseph J. Strout
   Re: 3D animation   -   Joseph J. Strout
   Re: 3D animation   -   Joe Raffanti
   Re: 3D animation   -   Joseph J. Strout

3D animation
Date: 23.02.05 19:37 (Wed, 23 Feb 2005 10:37:51 -0800)
From: Joe Raffanti
Hi everyone, I am attempting to make a 3D FPS, and I'm not
sure what approach to take for the animation of the characters in the
game. I want to make the characters' 3D models move when they walk,
so that they do not just glide along the ground. The characters are
3D meshes made in Meshwork.

One solution which seems very impractical would be to save
each character in each pose (there would be a different 3D model for
each character in each "frame" of movement), and during the walking
animation I would replace the last model with the next one to make it
appear to be moving.

I'm sure there is a better way to do this, such as modeling
the different poses, loading them into the game, and then calculating
the "frames" in between each of the modeled poses, which would act as
key frames. The application would automatically deform the mesh
depending on the positions of individual points. The only problem is
that I have no idea where to start with this method.

Any tips are appreciated,
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>

Re: 3D animation
Date: 23.02.05 19:56 (Wed, 23 Feb 2005 10:56:43 -0800)
From: Joe Raffanti
Sorry about my last message; I wrote it before searching the
archives, and I have found a good explanation of 3D animation options
there.

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>

Re: 3D animation
Date: 24.02.05 03:53 (Wed, 23 Feb 2005 20:53:49 -0600)
From: Joseph J. Strout
At 10:37 AM -0800 2/23/05, Joe Raffanti wrote:

> Hi everyone, I am attempting to make a 3D FPS, and I'm not
>sure what approach to take for the animation of the characters in
>the game. I want to make the characters' 3D models move when they
>walk, so that they do not just glide along the ground. The
>characters are 3D meshes made in Meshwork.
>
> One solution which seems very impractical would be to save
>each character in each pose (there would be a different 3D model for
>each character in each "frame" of movement), and during the walking
>animation I would replace the last model with the next one to make
>it appear to be moving.

That's not completely impractical; it's essentially how sprite games
work. However, you would certainly want to do some compression on
your model files, because they'll be huge -- but they'll compress
down to almost nothing, given that the texture data is the same in
each frame.

But I agree, this isn't the best approach.

> I'm sure there is a better way to do this, such as modeling
>the different poses, loading them into the game, and then
>calculating the "frames" in between each of the modeled poses, which
>would act as key frames.

Right, this is morph animation in its simplest form -- you just
interpolate the position of each vertex between the key frames. And
this is what I would recommend. It's also not too hard to do, if
you're willing to roll up your sleeves and put in a weekend or so of
work on it.

Start by looking up the article in REALbasic developer on "Mesh
Deformation". That will explain how to peek inside the Trimesh data
structure, find the vertex positions, and muck with them. It also
includes demo code, which moves the vertices based on a physics
simulation (flag flapping in the breeze) rather than for
interpolation, but I'm sure you'll get the idea.

BTW, since you're interested in making a FPS, you might want to also
check out the articles on "Make Your Own First-Person Shooter" and
"Renegades". You're welcome to take the Renegades code as a starting
point, if you like. We're not using very much mesh deformation,
though I think we do use it in a couple of places. (We do a lot more
UV animation, FWIW.)

> The application would automatically deform the mesh depending on
>the positions of individual points. The only problem is that I have
>no idea where to start with this method.

I'd say, start with the Mesh Deformation article -- you should be
able to order the back-issue from RB Developer, maybe even as a PDF
so you don't have to wait for the mail. You can find full references
for all articles I've written at
<http://www.strout.net/info/personal/>.

If feeling both ambitious and impatient, you could also try to skip
the article and dig directly into the examples; see the "Quesa
Declares" example on the CD, as well as the Renegades source base
(http://www.codenautics.com/renegades).

Best,
- Joe

Re: 3D animation
Date: 26.02.05 21:53 (Sat, 26 Feb 2005 15:53:39 -0500)
From: LMSpam neuropop.com

On Feb 26, 2005, at 4:30 PM, Joe Raffanti wrote:

> Thanks a lot, that really clarified things for me. I also checked the
> archives and found an email on 3D animation which had a large section
> about morph maps. I am trying to implement the ideas in that email in
> a rb class, "morphMap" (if someone has already accomplished this,
> could you let me know?).
>

Please let me know too!!!

L

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

Re: 3D animation
Date: 26.02.05 22:30 (Sat, 26 Feb 2005 13:30:33 -0800)
From: Joe Raffanti
Thanks a lot, that really clarified things for me. I also
checked the archives and found an email on 3D animation which had a
large section about morph maps. I am trying to implement the ideas in
that email in a rb class, "morphMap" (if someone has already
accomplished this, could you let me know?).

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? (I have been looking through trimesh
examples, but still cannot make any sense of how they work)
I know how to read and edit a 3DMF file while opening it, but
I don't think that would work on the fly.

Thanks,
Joe Raffanti

>At 10:37 AM -0800 2/23/05, Joe Raffanti wrote:
>
>> Hi everyone, I am attempting to make a 3D FPS, and I'm not
>>sure what approach to take for the animation of the characters in
>>the game. I want to make the characters' 3D models move when they
>>walk, so that they do not just glide along the ground. The
>>characters are 3D meshes made in Meshwork.
>>
>> One solution which seems very impractical would be to save
>>each character in each pose (there would be a different 3D model
>>for each character in each "frame" of movement), and during the
>>walking animation I would replace the last model with the next one
>>to make it appear to be moving.
>
>That's not completely impractical; it's essentially how sprite games
>work. However, you would certainly want to do some compression on
>your model files, because they'll be huge -- but they'll compress
>down to almost nothing, given that the texture data is the same in
>each frame.
>
>But I agree, this isn't the best approach.
>
>> I'm sure there is a better way to do this, such as modeling
>>the different poses, loading them into the game, and then
>>calculating the "frames" in between each of the modeled poses,
>>which would act as key frames.
>
>Right, this is morph animation in its simplest form -- you just
>interpolate the position of each vertex between the key frames. And
>this is what I would recommend. It's also not too hard to do, if
>you're willing to roll up your sleeves and put in a weekend or so of
>work on it.
>
>Start by looking up the article in REALbasic developer on "Mesh
>Deformation". That will explain how to peek inside the Trimesh data
>structure, find the vertex positions, and muck with them. It also
>includes demo code, which moves the vertices based on a physics
>simulation (flag flapping in the breeze) rather than for
>interpolation, but I'm sure you'll get the idea.
>
>BTW, since you're interested in making a FPS, you might want to also
>check out the articles on "Make Your Own First-Person Shooter" and
>"Renegades". You're welcome to take the Renegades code as a
>starting point, if you like. We're not using very much mesh
>deformation, though I think we do use it in a couple of places. (We
>do a lot more UV animation, FWIW.)
>
>> The application would automatically deform the mesh depending on
>>the positions of individual points. The only problem is that I have
>>no idea where to start with this method.
>
>I'd say, start with the Mesh Deformation article -- you should be
>able to order the back-issue from RB Developer, maybe even as a PDF
>so you don't have to wait for the mail. You can find full
>references for all articles I've written at
><http://www.strout.net/info/personal/>.
>
>If feeling both ambitious and impatient, you could also try to skip
>the article and dig directly into the examples; see the "Quesa
>Declares" example on the CD, as well as the Renegades source base
>(http://www.codenautics.com/renegades).
>
>Best,
>- Joe
>
>--
>REAL World 2005 - The REALbasic User Conference
>March 23-25, 2005, Austin, Texas
><http://www.realsoftware.com/realworld>
>_______________________________________________
>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>

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

Re: 3D animation
Date: 26.02.05 23:20 (Sat, 26 Feb 2005 17:20:43 -0500)
From: Frank Condello
On 26-Feb-05, at 4:30 PM, Joe Raffanti wrote:

> ...
>
> 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? (I have been looking through trimesh
> examples, but still cannot make any sense of how they work)

Check out my Quesa Wrappers: <http://developer.chaoticbox.com>. The
Trimesh3D class allows for fairly efficient vertex editing as-is,
though for the best possible speed you should keep a local copy of the
trimesh data in a memoryblock and upload it as needed. The wrappers
allow for this approach as well, but it's a bit more advanced (i.e.
more work than the generic built-in methods).

Frank.
------------
Open Source RB Plugins and Classes
<http://developer.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>

Re: 3D animation
Date: 27.02.05 21:08 (Sun, 27 Feb 2005 14:08:00 -0600)
From: Joseph J. Strout
At 1:30 PM -0800 2/26/05, Joe Raffanti wrote:

> Thanks a lot, that really clarified things for me. I also
>checked the archives and found an email on 3D animation which had a
>large section about morph maps. I am trying to implement the ideas
>in that email in a rb class, "morphMap" (if someone has already
>accomplished this, could you let me know?).

Nobody has -- but are you sure you need that much flexibility? This
is one of those power/complexity tradeoffs. I'm keen on morph maps
because they offer a lot of flexibility, but for your app, just
interpolating between two shapes ought to do the job.

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

> I know how to read and edit a 3DMF file while opening it, but
>I don't think that would work on the fly.

Quite right.

Best,
- Joe

Re: 3D animation
Date: 27.02.05 21:10 (Sun, 27 Feb 2005 14:10:55 -0600)
From: Joseph J. Strout
At 5:20 PM -0500 2/26/05, Frank Condello wrote:

>Check out my Quesa Wrappers: <http://developer.chaoticbox.com>. The
>Trimesh3D class allows for fairly efficient vertex editing as-is,
>though for the best possible speed you should keep a local copy of
>the trimesh data in a memoryblock and upload it as needed. The
>wrappers allow for this approach as well, but it's a bit more
>advanced (i.e. more work than the generic built-in methods).

For what it's worth, the code used in the Mesh Deformation article is
already structured that way.

However, Frank's Quesa Wrappers allow for lots of other cool things
too, and are well worth a look.

Best,
- Joe

Re: 3D animation
Date: 28.02.05 19:30 (Mon, 28 Feb 2005 10:30:36 -0800)
From: Joe Raffanti
>>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>

Re: 3D animation
Date: 28.02.05 20:00 (Mon, 28 Feb 2005 13:00:58 -0600)
From: Joseph J. Strout
At 10:30 AM -0800 2/28/05, Joe Raffanti wrote:

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

Sounds cool!

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

Very neat. I'm glad to hear you've got it working so nicely. Can't
wait to see your FPS game!

Best,
- Joe