Attaching object to mesh outline

Started by
2 comments, last by ChristOwnsMe 10 years, 7 months ago

I am trying to achieve the following:

http://imgbin.org/index.php?page=image&id=14922

I want to have a point that can "attach" to a mesh and follow its outline, but I cannot for the life of me think of how to do this. Any ideas? Thank you.

Advertisement

If the mesh is mostly flat with some variable hills like the image maybe you could get away with a simple raycast 'into' the mesh to essentially ground clamp to it.If it can be an arbitrarily 3d mesh you need to follow around I'm not sure there is a simple way to do that.

bones? or no bones?

no bones? hmm....

you'd need to associate your point with a vertex on the mesh, define a distance from the surface of the mesh to be maintained, then compute the point's location based on the desired distance and the vertex position.

but in what direction ?

well, in the direction of the vertex normal might be the first thing to try, or perhaps in a direction which is the average of the face normals of all triangles connected to the vertex. this would give more uniform (smoother) results with a dynamic mesh.

Norm Barrows

Rockland Software Productions

"Building PC games since 1989"

rocklandsoftware.net

PLAY CAVEMAN NOW!

http://rocklandsoftware.net/beta.php

So I am using bones, but I thought it'd be easier to just have one point in the center of the character be the point that is tracked in relation to the wall. This way I can just make the animation look like it is climbing the wall without having to worry about all the limb colllisions etc. The cave walls can curve into an overhang too, so I don't think I can just cast in one direction since the wall you are climbing can vary if it is left, up or right.

This topic is closed to new replies.

Advertisement