Xbox LIVE Indie Games
Sort Discussions: Previous Discussion Next Discussion
Page 1 of 1 (7 posts)

weapon slash animation

Last post 5/19/2011 5:49 AM by Ns79. 6 replies.
  • 5/18/2011 8:17 AM

    weapon slash animation

    Im trying to think of a way to display the trail of the slash of a weapon.  right now im trying particles, but I just assume that there must be a more standard way of doing it. I mean, if i wanted to show fire particles in my wake this works, but trying to display the full slash during an animation is proving difficult for me.
  • 5/18/2011 8:20 AM In reply to

    Re: weapon slash animation

    i maen it draws, but its not what is used obviously.  Perhaps i could keep up with pts in the path and draw a line primitive, bu tmy problem with that is that i dont want just a skinny line, was there a way to change the size of the lines with draw primitives?
  • 5/18/2011 3:36 PM In reply to

    Re: weapon slash animation

    Are you in 2D or 3D? How are you animating your slash without the effect you're after? (sprite animation, pixel shader, etc)
  • 5/19/2011 1:49 AM In reply to

    Re: weapon slash animation

    its a skinned fbx file in 3d.  i switched to using particles, and got some decent looks at it, the problem was i was only adding a one particle for the tip of the sword.  so sometimes you could see the space between them, then the transparency factor made it so that you could clearly see the dif particles separate. i think maybe ill try interpolating betwen the last added particle and the next, still havent figured out what ill do about the stacking transparency
  • 5/19/2011 2:52 AM In reply to

    Re: weapon slash animation

    Answer
    Reply Quote
    You want a ribbon trail.

    Decide on a number of frames of duration -- say, 30.
    Then create a triangle list that draws a "ribbon" of that many quads -- this could be a triangle strip or list, with 60 triangles. This gives you 31 pairs of "top/bottom" vertices for the ribbon.
    Then, each frame, you shift the position of each pair of vertices "over" one -- vertex 0 becomes vertex 2, vertex 1 becomes vertex 3, etc. Then find the top and the hilt of the sword, and set the top/bottom of the front of the ribbon -- vertex 0 and 1 -- to those positions.

    This will give you a ribbon that covers the last 30 frames of animation of the sword. Texture some glowy texture, typically that is brighter to the top-left and duller to the bottom-right, across this ribbon, in blended/pre-multiplied mode, and you're done!

  • 5/19/2011 4:25 AM In reply to

    Re: weapon slash animation

    Answer
    Reply Quote
    A solution that I came up with for this type of effect for a game I worked on is to actually use separate rigid animated 3D models which are animated along side the original animation.
    The reason we chose this as a solution was it was quite easy to implement through code and allowed the artist a lot more control of how these effects would look. The effects were mostly made up of multiple different planes that were alpha mapped.
  • 5/19/2011 5:49 AM In reply to

    Re: weapon slash animation

    THANK YOU BOTH.  Jwatte that is exactly what I wanted, thanks for that info.  Mark at one point i was going to attempt your implementation somewhat, nowhere near as thought out tho, but i think jwattes implementation would be easier to work with.
Page 1 of 1 (7 posts) Previous Discussion Next Discussion