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