|
||||||||||||||||||
Add Forum to Favorites | Send Topic To a Friend | View Forum FAQ | Track this topic |
Last Thread Next Thread ![]() |
| trail implement |
|
![]() Runoo Member since: 12/2/2008 From: Taipei, Taiwan, Province of China |
||||
|
|
||||
| Hi, I just implement a trail attach to a sword, but it is not smooth when sword changing position quickly. I wonder how to achieve this kind of smooth in this video: http://www.youtube.com/watch?v=EFPJ0W9LpKQ Any suggestion? Thank you! |
||||
|
||||
![]() raigan Member since: 12/5/2006 |
||||
|
|
||||
| Haven't tried it, but a guess: each frame, calculate the worldspace position of some points on the sword (the top and bottom for instance), and save these in a list; then, draw trails by connecting those points. |
||||
|
||||
![]() gzboli Member since: 1/21/2008 From: Redmond, WA, United States |
||||
|
|
||||
Quote: To address this specifically... If a sword swing takes 1/2 of a second and the game is running at 30 fps then that swing only lasts 15 frames. If you are generating only one new point per frame for the trail then it may look jagged. Have you tried you taking multiple, interpolated samples each frame? |
||||
|
||||
![]() Martin Member since: 9/11/1999 |
||||
|
|
||||
Quote: Yep, you can update your animation at a higher frequency than your frame rate to find intermediate points or you can pass a spline through the top and bottom set of points and find intermediate points that way. Running the animation at a higher frequency is likely to be higher quality but more CPU intensive. I would recommend using a catmull rom spline as this passes through all the points generated by the animation. You will have to duplicate the current time point in order that the trail actually reaches the current frame. http://www.mvps.org/directx/articles/catmull/ Cheers, Martin |
||||
|
||||
![]() Runoo Member since: 12/2/2008 From: Taipei, Taiwan, Province of China |
||||
|
|
||||
Quote: Thank you all! I will try using catmull rom curve to implement the trail effect. |
||||
|
||||
All times are ET (US)![]() |
Last Thread Next Thread ![]() |
|