Jump to content

View more

Image of the Day

Working on an auto spawn system. #gamedev #indiedev #screenshotsaturday https://t.co/Mm2kfekz7b
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

Sign up now

Triangle strip rotation

4: Adsense

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
No replies to this topic

#1 football94   Members   


Posted 23 September 2013 - 10:34 PM

Hi guys


Ive been working on a ribbon trail or sword slash effect following certain instructions(link below) and have been using

the extended xna skinning sample as a platform for experimentation, so far Im just using a small triangle strip for testing

purposes. I feel as though Im pretty close but Im stuck at the placement of the strip rotation wise,right now the strip is sitting

in a vertical position parallel to the forearm(picture below) and what I would like to do is rotate the strip in a horizontal position if anyone has any advice on how this would done it would be much appreciated.







link to instructions by jwatte



extended skinning sample link




picture of strip

9 23 2013 8 50 59 PM.jpeg





bone location code below


 Vector3 position ;

/// <summary>
        /// Draws the baseball bat.
        /// </summary>
        void DrawBaseballBat1(Matrix view, Matrix projection)
            int handIndex = skinningData.BoneIndices["L_Forearm"];

            Matrix[] worldTransforms = animationPlayer.GetWorldTransforms();

            // Nudge the bat over so it appears between the left thumb and index finger.
            batWorldTransform1 = Matrix.CreateTranslation(position) *


drawing code

 //draw triangles
            device.RenderState.CullMode = CullMode.None;
            basicEffect.World = batWorldTransform1 ;
            basicEffect.View = view;
            basicEffect.Projection = projection;
            basicEffect.VertexColorEnabled = true;

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

triangle strip code

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


                    if (animationPlayer.currentTimeValue < TimeSpan.FromMilliseconds(24))

                        vertices[11] = new VertexPositionColor(new Vector3(-5, 1, 1)  , Color.Red);
                        vertices[10] = new VertexPositionColor(new Vector3(-5, 5, 1) , Color.Red);


            if (animationPlayer.currentTimeValue < TimeSpan.FromMilliseconds(44))
                vertices[9] = new VertexPositionColor(new Vector3(-3, 1, 1), Color.Red);
                vertices[8] = new VertexPositionColor(new Vector3(-3, 5, 1) , Color.Green);


            if (animationPlayer.currentTimeValue < TimeSpan.FromMilliseconds(64))
                vertices[7] = new VertexPositionColor(new Vector3(-1, 1, 1), Color.Green);
                vertices[6] = new VertexPositionColor(new Vector3(-1, 5, 1), Color.Green);


            if (animationPlayer.currentTimeValue < TimeSpan.FromMilliseconds(84))
                vertices[5] = new VertexPositionColor(new Vector3(1, 1, 1), Color.Orange);
                vertices[4] = new VertexPositionColor(new Vector3(1, 5, 1), Color.Orange);


            if (animationPlayer.currentTimeValue < TimeSpan.FromMilliseconds(104))
                vertices[3] = new VertexPositionColor(new Vector3(3, 1, 1), Color.Orange);
                vertices[2] = new VertexPositionColor(new Vector3(3, 5, 1), Color.Yellow);


            if (animationPlayer.currentTimeValue < TimeSpan.FromMilliseconds(124))
                vertices[1] = new VertexPositionColor(new Vector3(5, 1, 1)* position1, Color.Yellow);
                vertices[0] = new VertexPositionColor(new Vector3(5, 5, 1)* position, Color.Yellow);


            return false;

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.