Skip to main content
corrected spelling
Source Link
Suic
  • 119
  • 6
float rotation = PI / 4; // 45 degrees

Matrix bone1Matrix = Matrix.identity().translate(Bone1.localPosition).rotateX(rotation)

Matrix bone2Matrix = bone1Matrix.multiply(Matrix.identity().translate(Bone2.localPosition).rotateX(rotation)

Matrix bone3Matrix = bone2Matrix.multiply(Matrix.identity().translate(Bone3.localPosition).rotateX(rotation)

Matrix bone4Matrix = bone3Matrxbone3Matrix.multiply(Matrix.identity().translate(Bone4.localPosition).rotateX(rotation) 
float rotation = PI / 4; // 45 degrees

Matrix bone1Matrix = Matrix.identity().translate(Bone1.localPosition).rotateX(rotation)

Matrix bone2Matrix = bone1Matrix.multiply(Matrix.identity().translate(Bone2.localPosition).rotateX(rotation)

Matrix bone3Matrix = bone2Matrix.multiply(Matrix.identity().translate(Bone3.localPosition).rotateX(rotation)

Matrix bone4Matrix = bone3Matrx.multiply(Matrix.identity().translate(Bone4.localPosition).rotateX(rotation) 
float rotation = PI / 4; // 45 degrees

Matrix bone1Matrix = Matrix.identity().translate(Bone1.localPosition).rotateX(rotation)

Matrix bone2Matrix = bone1Matrix.multiply(Matrix.identity().translate(Bone2.localPosition).rotateX(rotation)

Matrix bone3Matrix = bone2Matrix.multiply(Matrix.identity().translate(Bone3.localPosition).rotateX(rotation)

Matrix bone4Matrix = bone3Matrix.multiply(Matrix.identity().translate(Bone4.localPosition).rotateX(rotation) 
Made a mistake in my last example
Source Link
Suic
  • 119
  • 6
float rotation = PI / 4; // 45 degrees

Matrix bone1Matrix = Matrix.identity().translate(Bone1.localPosition).rotateX(rotation)

Matrix bone2Matrix = bone1Rotationbone1Matrix.multiply(Matrix.identity().translate(Bone2.localPosition).rotateX(rotation)

Matrix bone3Matrix = bone2Rotationbone2Matrix.multiply(Matrix.identity().translate(Bone3.localPosition).rotateX(rotation)

Matrix bone4Matrix = bone3Rotationbone3Matrx.multiply(Matrix.identity().translate(Bone4.localPosition).rotateX(rotation) 
float rotation = PI / 4; // 45 degrees

Matrix bone1Matrix = Matrix.identity().translate(Bone1.localPosition).rotateX(rotation)

Matrix bone2Matrix = bone1Rotation.multiply(Matrix.identity().translate(Bone2.localPosition).rotateX(rotation)

Matrix bone3Matrix = bone2Rotation.multiply(Matrix.identity().translate(Bone3.localPosition).rotateX(rotation)

Matrix bone4Matrix = bone3Rotation.multiply(Matrix.identity().translate(Bone4.localPosition).rotateX(rotation) 
float rotation = PI / 4; // 45 degrees

Matrix bone1Matrix = Matrix.identity().translate(Bone1.localPosition).rotateX(rotation)

Matrix bone2Matrix = bone1Matrix.multiply(Matrix.identity().translate(Bone2.localPosition).rotateX(rotation)

Matrix bone3Matrix = bone2Matrix.multiply(Matrix.identity().translate(Bone3.localPosition).rotateX(rotation)

Matrix bone4Matrix = bone3Matrx.multiply(Matrix.identity().translate(Bone4.localPosition).rotateX(rotation) 
added my current understanding of how i could possibly do it with matrices
Source Link
Suic
  • 119
  • 6

Using matrices this is what i thought could potentially work, but im not 100% sure: if i were to rotate Bone1 which has 3 children(including indirect) (Bone 2-4)

float rotation = PI / 4; // 45 degrees

Matrix bone1Matrix = Matrix.identity().translate(Bone1.localPosition).rotateX(rotation)

Matrix bone2Matrix = bone1Rotation.multiply(Matrix.identity().translate(Bone2.localPosition).rotateX(rotation)

Matrix bone3Matrix = bone2Rotation.multiply(Matrix.identity().translate(Bone3.localPosition).rotateX(rotation)

Matrix bone4Matrix = bone3Rotation.multiply(Matrix.identity().translate(Bone4.localPosition).rotateX(rotation) 

And the origin of each bone would just be the translation part of their matrix(just a guess)

the rotation of each bone would either be the accumulated rotation or the initial rotation(i'd assume it's the latter)

Using matrices this is what i thought could potentially work, but im not 100% sure: if i were to rotate Bone1 which has 3 children(including indirect) (Bone 2-4)

float rotation = PI / 4; // 45 degrees

Matrix bone1Matrix = Matrix.identity().translate(Bone1.localPosition).rotateX(rotation)

Matrix bone2Matrix = bone1Rotation.multiply(Matrix.identity().translate(Bone2.localPosition).rotateX(rotation)

Matrix bone3Matrix = bone2Rotation.multiply(Matrix.identity().translate(Bone3.localPosition).rotateX(rotation)

Matrix bone4Matrix = bone3Rotation.multiply(Matrix.identity().translate(Bone4.localPosition).rotateX(rotation) 

And the origin of each bone would just be the translation part of their matrix(just a guess)

the rotation of each bone would either be the accumulated rotation or the initial rotation(i'd assume it's the latter)

added 47 characters in body
Source Link
Suic
  • 119
  • 6
Loading
added 521 characters in body
Source Link
Suic
  • 119
  • 6
Loading
added 648 characters in body
Source Link
Suic
  • 119
  • 6
Loading
Source Link
Suic
  • 119
  • 6
Loading