IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> hpr with respect to joint frames, hpr with respect to joint frames
shadowchaser
post Sep 14 2009, 08:06 AM
Post #1


Newbie
*

Group: Members
Posts: 1
Joined: 14-September 09
Member No.: 9,328



Hi there,

I have some questions about joint frames.

1) Is it possible to obtain an actors orientation with respect to a joint frame ? How can I do it ?
2) Is it possible to obtain an actors position with respect to a joint frame ? How can I do it ?
Go to the top of the page
 
+Quote Post
Bob2u
post Oct 30 2009, 07:42 PM
Post #2


Member
**

Group: Members
Posts: 9
Joined: 2-October 09
Member No.: 9,495



You will need to construct the joint frame matrix and multiply the actor's frame into the inverse of the joint. This will take the actor's frame into joint frame. I'm doing a similar thing at the moment, but I am not sure if I am correct since I am doing it relative to the other actors frame and not the joint.

For position you can multiply the offset vector (actor's local space relative) to the actor's pose and get it to global. From there you can either use the joint anchor and other actors offset and position to find the difference vector. Same goes for the orientations, I use dot products between the actor's pose and inverse of joint to get the angles and sign of the angle in radians. Hope this gives you some ideas. I may be able to post some code once I get mine working.
Go to the top of the page
 
+Quote Post
Bob2u
post Nov 3 2009, 01:51 PM
Post #3


Member
**

Group: Members
Posts: 9
Joined: 2-October 09
Member No.: 9,495



just to followup in case you are still working on this problem. I implemented something I am happy with (not sure it covers angular 100% but as long a single axis is rotated I'm OK).

I made a matrix like this

impl->m1.M.setRow(0, impl->desc.localAxis[0] );
impl->m1.M.setRow(1, impl->desc.localNormal[0] );
impl->m1.M.setRow(2, impl->desc.localAxis[0].cross( impl->desc.localNormal[0] ) );
impl->m1.t = impl->desc.localAnchor[0];

I then moved into the object space

NxMat34 p1 = impl->desc.actor[0]->getGlobalPose();

// update p1 and p2
NxMat34 m1( true );
m1.t = ( p1.M * impl->desc.localAnchor[0] ) + p1.t;

Do this for both ends of the constraint and finally:

NxVec3 diff = m2.t - m1.t;
position = diff.dot( m1.M.getRow(0) );

-----


my rotation is through vector projection but has singularities at 2 extremes, so I won't post it until I know it works. Let me know if you figure it out.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Copyright © 2008 NVIDIA® Corporation.  Terms of Use | Legal Info | Privacy Policy Time is now: 24th November 2009 - 02:13 AM