Java-Gaming.org Hi !
 Featured games (90) games approved by the League of Dukes Games in Showcase (731) Games in Android Showcase (217) games submitted by our members Games in WIP (799) games currently in development
 News: Read the Java Gaming Resources, or peek at the official Java tutorials
Pages: [1]
 ignore  |  Print
 Where is the rotation in a Matrix4f?  (Read 1141 times) 0 Members and 1 Guest are viewing this topic.
SEZ

Junior Newbie

Java games rock!

 « Posted 2004-05-16 03:20:25 »

Hello,
I'm not to good at matrices sorry.
Could anyone tell me which part of the Matrix has the rotation?

I have a ViewTransform and I want to get its direction(angle) and then set the transform to rotate the MD3 model I have to be in the same direction as the view.

Thanks for any help :-).
SEZ

P.S. This is my first post :-D, I've been viewing the forum for a while :-).
Jens

Senior Devvie

Java for games!

 « Reply #1 - Posted 2004-05-16 05:50:48 »

Quote
Hello,
I'm not to good at matrices sorry.
Could anyone tell me which part of the Matrix has the rotation?

The rotational component is the upper left 3x3 matrix.

Xith3D Getting Started Guide (PDF,HTML,Source)
SEZ

Junior Newbie

Java games rock!

 « Reply #2 - Posted 2004-05-16 10:43:57 »

Thanks for that seesm to be moving me along :-).

But I find that the players model, although it turns with the view in changes in size up and down as I turn and then goes back to normal at the rear of where it started been OK.

Here is what I'm doing:

Transform3D playerTrans = player.getTransform();

Matrix3f pm3f = new Matrix3f();
pm3f = playerTrans.getRotation(pm3f);

Matrix3f vm3f = new Matrix3f();
vm3f = viewTransform.getRotation(vm3f);

pm3f.m00 = vm3f.m00;
pm3f.m02 = vm3f.m02;

pm3f.m20 = vm3f.m20;
pm3f.m22 = vm3f.m22;

playerRotTrans.setRotation(pm3f);

player.setTransform(playerTrans);

Thanks again  :)

SEZ
SEZ

Junior Newbie

Java games rock!

 « Reply #3 - Posted 2004-05-16 10:47:40 »

Oh sorry about that, I just fixed it I had a transfrom below which I thought was needed to change the scale of the model, and well it seems it was doing it.

Thanks very much :-D.
Pages: [1]
 ignore  |  Print

You cannot reply to this message, because it is very, very old.

 Archive (341 views) 2017-04-27 17:45:51 buddyBro (538 views) 2017-04-05 03:38:00 CopyableCougar4 (988 views) 2017-03-24 15:39:42 theagentd (1020 views) 2017-03-24 15:32:08 Rule (995 views) 2017-03-19 12:43:22 Rule (978 views) 2017-03-19 12:42:17 Rule (975 views) 2017-03-19 12:36:21 theagentd (1077 views) 2017-03-16 05:07:07 theagentd (997 views) 2017-03-15 22:37:06 theagentd (771 views) 2017-03-15 22:32:18
 List of Learning Resourcesby elect2017-03-13 14:05:44List of Learning Resourcesby elect2017-03-13 14:04:45SF/X Librariesby philfrei2017-03-02 08:45:19SF/X Librariesby philfrei2017-03-02 08:44:05SF/X Librariesby SkyAphid2017-03-02 06:38:56SF/X Librariesby SkyAphid2017-03-02 06:38:32SF/X Librariesby SkyAphid2017-03-02 06:38:05SF/X Librariesby SkyAphid2017-03-02 06:37:51
 java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org