Sign in to follow this  
Bardack_x

How to allow player to walk in a Mesh?

Recommended Posts

Bardack_x    204

I am writing my own engine in Java and OpenGL (for fun and learning and because I have the free time) I have the rendering and animation parts done (sufficiently done).

 

I want the characters and player to walk a terrain represented by a Mesh, how do I do that?

Share this post


Link to post
Share on other sites
frob    44902

In addition to what HappyCoder wrote above, in many games there are multiple meshes involved.  One is used for rendering.  A second, simpler mesh is used for physics. A third greatly simplified mesh is used for navigation, pathfinding, and AI.

Share this post


Link to post
Share on other sites
Bardack_x    204

thanks for your responses; so the walking in a terrain feature should be delegated to the physics engine? —it's time to update that old particle only engine, xD— I wonder how pikmin handles it

Share this post


Link to post
Share on other sites
haegarr    7372
so the walking in a terrain feature should be delegated to the physics engine?

There are several sub-systems involved.

a.) AI (for the NPCs) for path finding: What way to go to reach the target location? As frob has mentioned, this can be solved by using a dedicated mesh.

b.) Animation blend controlling: Set by AI or player input, which kind of motion is used (walking, running, ...).

c.) Animation playback: How is the character posed at time.

d.) Collision correction: reacting on obstacles and ground.

 

Details depend on the kind of game and character implementation, of course. Assuming a 3D world with skeleton based characters...

 

Things are relatively easy if you are willing to accept some artifacts like foot sliding and averaged slopes and steps in terrain. It is not easy to get rid of those issues. A locomotion sub-system for foot placement is one possible undertaking. Foot sliding alone can also be reduced to a minimum if the animation playback is not controlled by time but by the made way; e.g. the Wolfire engine follows such a approach. So, for completeness we need to add:

 

e.) Locomotion control: foot placement and pose controlling.

 

However, most games especially in the hobby area do not deal with such complex things like locomotion.

Edited by haegarr

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this