Sign in to follow this  
Steve5050

Make Bone Rig

Recommended Posts

Using Vb.Net 2003 With DX 9.0c Dec 2004 I'm trying to make a bone rig from scratch so I can make some animated characters. I've tried .x file animation but it is not working with my app. I've been all over the net and cannot find any info on how to make a rig.If anybody can point me somewhere or show me how to do this that would be cool. I have made a point skeleton, but I'm not sure it is the right way to do it. I want to make it as efficiently as possible. Here is some code for a knee.
Public Class LKne
    Private Device As Device
    Dim Tick As Integer
    Dim XRotation As Single
    Dim YRotation As Single
    Dim ZRotation As Single
    Dim pLknee(0) As CustomVertex.TransformedColored
    Public Sub New(ByVal Device As Device)
        Me.Device = Device
        Me.pLknee(0) = New CustomVertex.TransformedColored(15, -35, 0, 1, Color.White.ToArgb()) 'lknee
    End Sub

    Public Sub RotationMatrices(ByVal X As Single, ByVal Y As Single, ByVal Z As Single)
        Device.Transform.World = Matrix.Multiply(Device.Transform.World, Matrix.RotationX(CSng(X * Math.PI / 180)))
        Device.Transform.World = Matrix.Multiply(Device.Transform.World, Matrix.RotationY(CSng(Y * Math.PI / 180)))
        Device.Transform.World = Matrix.Multiply(Device.Transform.World, Matrix.RotationZ(CSng(Z * Math.PI / 180)))
    End Sub 'RotationMatrices


    Public Sub TranslationMatrices(ByVal X As Single, ByVal Y As Single, ByVal Z As Single)
        Device.Transform.World = Matrix.Multiply(Device.Transform.World, Matrix.Translation(X, Y, Z))
    End Sub 'TranslationMatrices


    Public Sub ScaleMatrices(ByVal X As Single, ByVal Y As Single, ByVal Z As Single)
        Device.Transform.World = Matrix.Multiply(Device.Transform.World, Matrix.Scaling(X / 100, Y / 100, Z / 100))
    End Sub 'ScaleMatrices
    Public Sub Render()
        Tick = Environment.TickCount
       
        Device.Transform.World = Matrix.RotationYawPitchRoll(XRotation, YRotation, ZRotation)
        Device.DrawUserPrimitives(PrimitiveType.PointList, 1, Me.pLknee)
    End Sub
End Class

I did that for all the bones for which I have 25 so far,I didn't do the hands yet. I just think I'm going about it the wrong way. Thanks if you can help. Steve

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this