Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: actor bone issues  (Read 1715 times)
Aion
Customers
Community Member
*****
Posts: 152


WWW
« on: September 21, 2007, 11:20:44 AM »

There are some problems that still need to be fixed in setbonerotation and setbonetranslation:

http://www.truevision3d.com/forums/tv3d_sdk_65/setbonerotation-t16308.0.html
http://www.truevision3d.com/forums/tv3d_sdk_65/bone_positioning_and_rotation-t15888.0.html
http://www.truevision3d.com/forums/tv3d_sdk_63/bone_rotation-t15891.0.html
http://www.truevision3d.com/forums/tv3d_sdk_65/actorsetbonerotation_buggy_absolute_rotations-t15492.0.html

Please help, we really need this to function properly. Also, i am happy to supply examples and code to better define the problem if necissary.
 
Logged

Aion
Customers
Community Member
*****
Posts: 152


WWW
« Reply #1 on: November 18, 2007, 11:40:02 AM »

I really need a solution for this issue now.  Cry
I am writing the final version of my character animator for Neverdaunt, and I've been able to compensate for most of the other issues except for the absolute rotation bugs.

I have made a video of the issue: http://youtube.com/watch?v=Kh3AJu0dDXM
heres whats happening...

In my animator, i attach 3 rings(xyz) to the bone i want to rotate, then when i click on the ring and drag the mouse it rotates the bone using:

actor.SetBoneRotation(bone, value.x, value.y, value.z, True)

adding to x, y or z depending on which ring was clicked.
In the video you can see that initially the bone seems to rotate properly in all directions, but once it is moved to an arbitrary rotation only the blue ring continues to rotate on the correct axis, while the red and green rings rotate on some other offset axis. 

if this wont be fixed, it will suck, but I'll move on and start saving out my animation files... if it will be fixed, i have to wait to save animation files, because anything i save out wont animate properly when loaded in a fixed version. Tongue
Logged

Aion
Customers
Community Member
*****
Posts: 152


WWW
« Reply #2 on: November 20, 2007, 01:42:12 PM »

 Grin well, looks like this was all just a gimbal lock issue after all... after talking with Sylvain and adapting:
http://www.truevision3d.com/forums/tv3d_sdk_63/replacement_meshsetrotation_function-t9869.0.html;msg69070#msg69070
i was able to come up with a method using quaternions and actor.SetBoneRotationMatrix.

Code:
    Public Function Rotatotronic(ByVal Rot As MTV3D65.TV_3DVECTOR) As MTV3D65.TV_3DQUATERNION
        Dim QX, QY, QZ As MTV3D65.TV_3DQUATERNION
        Dim QRot As MTV3D65.TV_3DQUATERNION
        Dim V As MTV3D65.TV_3DVECTOR
        V = globals.Vector3(1, 0, 0)
        tvMath.TVQuaternionRotationAxis(QX, V, Rot.x)
        V = globals.Vector3(0, 1, 0)
        tvMath.TVQuaternionRotationAxis(QY, V, Rot.y)
        V = globals.Vector3(0, 0, 1)
        tvMath.TVQuaternionRotationAxis(QZ, V, Rot.z)
        tvMath.TVQuaternionMultiply(QRot, QX, QY)
        tvMath.TVQuaternionMultiply(QRot, QRot, QZ)
        Return QRot
    End Function

the code i use to rotate a bone
Code:
Dim q As MTV3D65.TV_3DQUATERNION
 q = Rotatotronic(globals.Vector3(x, y, z))
 tvMath.TVQuaternionMultiply(q, q, thing.bonequat(selbone))
 thing.bonequat(selbone) = q

inside the thing class that contains my actor:
Code:
  Public Property bonequat(ByVal bone As Integer) As MTV3D65.TV_3DQUATERNION
        Get
            Return boneq(bone)
        End Get
        Set(ByVal value As MTV3D65.TV_3DQUATERNION)
            Dim out As MTV3D65.TV_3DMATRIX
            tvMath.TVMatrixRotationQuaternion(out, value)
            boneq(bone) = value
            actor.SetBoneRotationMatrix(bone, out, True)
            actor.ComputeNormals()
        End Set
    End Property


hopefully this will help anyone else who runs into this issue.
Logged

SylvainTV
Administrator
Community Member
*****
Posts: 4946


WWW
« Reply #3 on: November 21, 2007, 01:48:00 PM »

YEa the thing here is that you are rotating in the order that suits you the most. X * Y * Z.
There are like 12 different possible orders Smiley
Logged

Regards

Sylvain Dupont
TrueVision3D Developer
sylvain@truevision3d.com

TV3D IRC at http://chat.truevision3d.com or on server irc.truevision3d.com #Truevision3D. Come talk with us !
fex
Customers
Community Member
*****
Posts: 258


« Reply #4 on: November 26, 2007, 05:55:37 PM »

Oooh, finally, some news on this topic.

Next time I crack open the CharGen project, I'll give this a whirl and see if it fits my needs, too. Cheesy
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks