OpenGL API Specifications
Documents and Learning ResourcesSupport Libraries and FrameworksFunction Libraries and GeneratorsThis list contains some basic resources for getting started with, and developing for, OpenGL 3.0 and onwards. Contact your forum moderator if you want to contribute to the list or have any comments.Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.
Posted 27 October 2012 - 10:25 AM
Posted 27 October 2012 - 11:52 AM
x = cos(45.0); y = sin(45.0);
Edited by rocklobster, 27 October 2012 - 12:06 PM.
Posted 27 October 2012 - 02:41 PM
Edited by Kaptein, 27 October 2012 - 02:51 PM.
Posted 27 October 2012 - 02:51 PM
1 0 0 0 1 0 0 0 1That will simply scale x with 1, y with 1 and z with 1. If you look at the next matrix, with only one number:
0 1 0 0 0 0 0 0 0This will scale y with 1 and add it to x. But x was scaled with 0 this time, so the only things that remains from this transformation is the value of y moved to x, while y and z is cleared. Now look at this:
0 0 0 1 0 0 0 0 0It is almost the same thing, but it will scale y with 1 and copy it to x, while scaling the old y with 0. So this time, y is moved to x. This is possible to combine. The following:
0 1 0 1 0 0 0 0 0Will thus swap x and y. Now we are getting closer to a rotation. Rotating 90 degrees around the z axis (in a right handed coordinate system) is the same as moving x to y while moving -y to x. That would be:
0 -1 0 1 0 0 0 0 0If you set alpha to 90 degrees in your example, you will see that this is what you get.
Posted 27 October 2012 - 03:17 PM
Edited by bigdilliams, 27 October 2012 - 03:19 PM.
Posted 27 October 2012 - 05:28 PM
Posted 28 October 2012 - 04:59 PM
Edited by Caburé, 31 October 2012 - 11:17 AM.
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.
GameDev.net™, the GameDev.net logo, and GDNet™ are trademarks of GameDev.net, LLC.