Author Topic: Silly Matrix question  (Read 3573 times)

Offline .jayderyu

  • long
  • ***
  • Posts: 116
    • View Profile
Silly Matrix question
« on: January 15, 2010, 12:51:24 am »
It's a simple answer to those that know, but i'm a bit of a Matrix twit :\   

JPCT has a different Y Z axis on a rotation. In an Object3D.getDump().
How would I change it to mirror the YZ value.

My thought was some thing like this.
Code: [Select]
[0,    *-1, *-1,  0]
[*-1, *-1,    0,  0]
[*-1,    0, *-1,  1]
[   0,    0,    0,  0]
The idea was flipping the values for YZ rotation assuming row major. I think. I've been searching the web so I'm more guessing.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Silly Matrix question
« Reply #1 on: January 15, 2010, 10:24:26 am »
This should do it:

Code: [Select]
mat.rotateX((float) Math.PI);

Offline .jayderyu

  • long
  • ***
  • Posts: 116
    • View Profile
Re: Silly Matrix question
« Reply #2 on: January 15, 2010, 07:41:49 pm »
well, that's so simple no wonder I missed it. Of course. Rotate along the X by PI that flips both. sigh. No wonder it took a long time for an answer. It was just obvious. :P