I'm trying to create weapon trails: when my player swings his sword from side to side, a "ghost" trail should appear right after the blade, and then fade away in a few millisecs.
I've found in the code archives some piece of code, which creates a trail after a vehicle, by using the method of drawing a surface between two entities: the program obtains their respective positions, then draws the trail right after both objects, then continues drawing the trail longer and longer...
So, this program, which runs perfectly and smoothly, requires two entities, with different positions, to start drawing a trail.
The problem is: my player's model is an animated b3d entity. When I try to create and add two meshes to this model, near the beginning and the end of the sword's blade, they won't animate with the sword. Of course the generated trail does not follow sword path.
The question is: Is there a reasonable way two objects can be positioned, in real time - while animation is playing, in the beginning and at the end of the sword blade?
Otherwise, is there a way of knowing a vertex x,y,z (global position) in realtime, if this vertex is part of an animated model (.b3d), and the model is animating?
Thank you
|