Jump to content

  • Log In with Google      Sign In   
  • Create Account

Ribbon trail technique

Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 football94   Members   -  Reputation: 198


Posted 14 September 2013 - 12:10 AM

Hi guys


Ive been researching the subject of the ribbon trail technique or the sword slash effect (picture below) and was wondering if anyone could provide any advice on how  this is implemented from one time frame of an animated model to the next.







#2 Norman Barrows   Crossbones+   -  Reputation: 2121


Posted 14 September 2013 - 12:03 PM

looks like alpha blended polys with various smoothing algos applied. they may be doing some realtime gradient texture thing too.

Norm Barrows

Rockland Software Productions

"Building PC games since 1988"




#3 football94   Members   -  Reputation: 198


Posted 15 September 2013 - 07:28 PM

I came across a forum topic(link below)  in which the contributor jwatte  gave instructions on how to put together a ribbon trail

but the part where he writes "each frame, you shift the position of each pair of vertices "over" one -- vertex 0 becomes vertex 2, vertex 1 becomes vertex 3, etc." .Im not sure how I would go about implementing this part



ribbon trail link




trianglestrip code

using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace TRISTRIP
    public class Game1 : Microsoft.Xna.Framework.Game
        GraphicsDeviceManager graphics;
        GraphicsDevice device;
        BasicEffect basicEffect;
        QuakeCamera fpsCam;
        CoordCross cCross;

        VertexPositionColor[] vertices;
        VertexDeclaration myVertexDeclaration;

        public Game1()
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

        protected override void Initialize()
            fpsCam = new QuakeCamera(GraphicsDevice.Viewport);            

        protected override void LoadContent()
            device = graphics.GraphicsDevice;
            basicEffect = new BasicEffect(device, null);
            cCross = new CoordCross(device);

        private void InitVertices()
            myVertexDeclaration = new VertexDeclaration(device, VertexPositionColor.VertexElements);
            vertices = new VertexPositionColor[12];

            vertices[0] = new VertexPositionColor(new Vector3(-5, 1, 1), Color.Red);
            vertices[1] = new VertexPositionColor(new Vector3(-5, 5, 1), Color.Green);
            vertices[2] = new VertexPositionColor(new Vector3(-3, 1, 1), Color.Blue);

            vertices[3] = new VertexPositionColor(new Vector3(-3, 5, 1), Color.Gray);
            vertices[4] = new VertexPositionColor(new Vector3(-1, 1, 1), Color.Purple);
            vertices[5] = new VertexPositionColor(new Vector3(-1, 5, 1), Color.Orange);

            vertices[6] = new VertexPositionColor(new Vector3(1, 1, 1), Color.BurlyWood);
            vertices[7] = new VertexPositionColor(new Vector3(1, 5, 1), Color.Gray);
            vertices[8] = new VertexPositionColor(new Vector3(3, 1, 1), Color.Green);

            vertices[9] = new VertexPositionColor(new Vector3(3, 5, 1), Color.Yellow);
            vertices[10] = new VertexPositionColor(new Vector3(5, 1, 1), Color.Blue);
            vertices[11] = new VertexPositionColor(new Vector3(5, 5, 1), Color.Red);

        protected override void UnloadContent()

        protected override void Update(GameTime gameTime)
            GamePadState gamePadState = GamePad.GetState(PlayerIndex.One);
            if (gamePadState.Buttons.Back == ButtonState.Pressed)

            MouseState mouseState = Mouse.GetState();
            KeyboardState keyState = Keyboard.GetState();
            if (keyState.IsKeyDown(Keys.Escape))
                this.Exit(); // Exit with ESC key

            fpsCam.Update(mouseState, keyState, gamePadState);


        protected override void Draw(GameTime gameTime)
            device.Clear(ClearOptions.Target | ClearOptions.DepthBuffer, Color.CornflowerBlue, 1, 0);

            cCross.Draw(fpsCam.ViewMatrix, fpsCam.ProjectionMatrix);

            //draw triangles
            device.RenderState.CullMode = CullMode.None;
            basicEffect.World = Matrix.Identity;
            basicEffect.View = fpsCam.ViewMatrix;
            basicEffect.Projection = fpsCam.ProjectionMatrix;
            basicEffect.VertexColorEnabled = true;

            foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes)
                device.VertexDeclaration = myVertexDeclaration;
                device.DrawUserPrimitives<VertexPositionColor>(PrimitiveType.TriangleStrip, vertices, 0, 10);


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.