How to animate fish meshes

Post your questions, suggestions and experiences regarding game design, integration of external libraries here. For irrEdit, irrXML and irrKlang, see the
ambiera forums
Post Reply
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

How to animate fish meshes

Post by robmar »

To make a virtual fish tank, there are sources of good fish models, but all are unamimated.

NVidia have a sample that modifies the meshes of the fish, applying a Sin function along the axis to make them "swim".

What would be the best way to do this using Irrlicht?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: How to animate fish meshes

Post by hybrid »

Check the water scene node. It's the same idea, but a simpler mesh structure. I guess you need to find a good way to assign to each vertex a "normalized" position. Applying the offset is notmuch of a problem then. Same goes for vertex shader of course, doesn't really matter which way you apply the offset.
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: How to animate fish meshes

Post by robmar »

Thanks for the tip, I´ll do that. I´m really not up to speed at all on mesh manipulation coding. I looked at the NVidia fish sample, but the mesh manipulations were done using functions I wasn´t familiar with, sort of looked complicated!
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: How to animate fish meshes

Post by robmar »

By the way, have you seen the OGRE water demo? It deforms the water mesh to simulate the wave buffeting caused when an objects swims across the surface. Do you think it would be fairly easy to translate these OGRE demos to Irrlicht? I know OGRE might seem to be the competition, but it might be interesting to see the speed difference running them on Irrlicht.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: How to animate fish meshes

Post by hybrid »

Yeah, the demo uses a very similar approach, just with more complex functions and the ability to touch at a certain position into the water. this is then updated every frame and the effect reduces. Hence, if you always touch at the position the object is, you get the effect of driving waves. The functions are all in, would probably only need a few minor adaptions.
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: How to animate fish meshes

Post by robmar »

thats what I thought. would be useful to a lot of game developers if it was incorporated. (OGRE and Irrlicht at first glance seem quite similar, both have the same philosophy of open platform, even have the same version number, is there a key difference I wonder...)
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: How to animate fish meshes

Post by serengeor »

robmar wrote:thats what I thought. would be useful to a lot of game developers if it was incorporated. (OGRE and Irrlicht at first glance seem quite similar, both have the same philosophy of open platform, even have the same version number, is there a key difference I wonder...)
I've had a look at both of them and to me ogre seams a bit more evolved. And it's not because they have pretty/shiny demos. For example the material system in ogre looks really much better. But irrlicht has its advantages too. It's fairly easy to customize and is quite easy to use even for a beginner.
Working on game: Marrbles (Currently stopped).
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: How to animate fish meshes

Post by hybrid »

I don't think that this is the topic of this thread - there are more useless threads where these discussions take place.
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: How to animate fish meshes

Post by robmar »

Well, if I can sort out the fish mesh manipulations, I´ll post it if anyone is interested.
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: How to animate fish meshes

Post by serengeor »

hybrid wrote:I don't think that this is the topic of this thread - there are more useless threads where these discussions take place.
Just wanted to share my opinion on that matter. :|

@robmar: you could probably add some bones in modeling software and create some animations yourself. Shouldn't be too hard to do as fishes aren't very complex (are they?).
As for swimming, you could try doing some random paths, with some checking of course(so they wouldn't swim through the aquarium). Maybe apply some functions that would make them go in more of a curvy motion from start to end point of the path.
Or instead of using random paths you could probably predefine lots of points in the aquarium from which the fishes could choose where to go next.
Working on game: Marrbles (Currently stopped).
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: How to animate fish meshes

Post by robmar »

Thanks, the paths I have sorted, using the spline path animator, etc., a friend is trying to animate the fish in blender, but she is really having problems, her fish are all upside down and she can´t figure how to define the centre for rotation, etc. As I haven´t time to learn blender, I thought I´d look for an Irrlicht-friendly mesh manipulation... there is a good sample from NVidia, but it uses their API, so I need to convert it if no one has a better reference. No pain no gain I guess! :)
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: How to animate fish meshes

Post by serengeor »

You need to center mesh at (0,0,0) cordinates to make it rotate around its center.
Working on game: Marrbles (Currently stopped).
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: How to animate fish meshes

Post by robmar »

yes, I know, but the friend that´s helping me with blender seems unable to do it. curious as to why, how difficult can it be! she´s been on it for days, sent mw about 10 versions, all are wrong!
Post Reply