Jointing Joints?

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Jointing Joints?

Postby Overhertz » Mon Jan 24, 2011 7:03 am

Hi there,

i'm trying to attack 2 hinge joints between 2 models but so far with no success...

doing so:
Code: Select all
  pinPivMatrix.clear;
  pinPivMatrix.M[2] := 1;
  pinPivMatrix.M[4] := 1;
  pinPivMatrix.M[9] := 1;
  pinPivMatrix.M[15] := 1;

  pinPivMatrix.M[12] := irrMat.getTranslation.x;
  pinPivMatrix.M[13] := irrMat.getTranslation.y;
  pinPivMatrix.M[14] := irrMat.getTranslation.z;

  wheels[wheelCount-1].obj.m_Joint := CreateCustomHinge(pinPivMatrix.pointer, wheels[wheelCount-1].obj.m_NewtonBody, vehicleBody.obj.m_NewtonBody);


this works fine, but then i'd like the 2nd joint added also

Code: Select all
  pinPivMatrix.clear;
  pinPivMatrix.M[0] := 1;
  pinPivMatrix.M[5] := 1;
  pinPivMatrix.M[10] := 1;

  pinPivMatrix.M[12] := irrMat.getTranslation.x;
  pinPivMatrix.M[13] := irrMat.getTranslation.y;
  pinPivMatrix.M[14] := irrMat.getTranslation.z;

  wheels[wheelCount-1].obj.t_Joint := CreateCustomHinge(pinPivMatrix.pointer, wheels[wheelCount-1].obj.m_NewtonBody, vehicleBody.obj.m_NewtonBody);


in which case it is locked in position with absolutly no movement whatsoever... how can i do this? i have been looking for a solution for 6-7 hours, including searching the forum upside down and googling everything i could think of. hope someone can help. thanks.
Ziron Programming Language
Download the Assembler HERE
User avatar
Overhertz
 
Posts: 112
Joined: Mon Jul 06, 2009 11:19 am

Re: Jointing Joints?

Postby ledahut » Mon Jan 31, 2011 4:09 am

Maybe your matrix is not orthogonal.

In the second code try to add
pinPivMatrix.M[15] := 1;


Newton wait from PinAndPivotMatrix a structure like that:
First row: the pin direction
Second and third rows are set to create an orthogonal matrix
Fourth: The pivot position


viewtopic.php?f=9&t=6035&p=43673&hilit=PinAndPivotMatrix#p43673
ledahut
 
Posts: 98
Joined: Mon Jun 21, 2010 8:03 am
Location: France


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests