# Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

### Dark GDK / Rotation Problems

Message
Posted: 28th Jul 2012 19:39 Edited at: 29th Jul 2012 00:21
I am currently making a three-d skeleton system but the z rotation gives me weird results. The program takes the angles and subdivides the angle into sub-angles, then adds the sub-angles to the existing angle. The angle is added too the previous angle as so.

next the code calls ROTATESPRITETZ2. The function ROTATESPRITETZ2 rotates the object and it children about the z axis. After the user is not pressing the mouse then it makes a animation from a previous frame to current frame as so.

this works for rotation about the y, and x axis

Right know I am only rotating about the x and y axis which seems too work fine.

ok, I found this on the web:

z' = z*cos q - x*sin q
x' = z*sin q + x*cos q
y' = y

(cos q 0 -sin q 0)
Ry(q) = (0 1 0 0)
(sin q 0 cos q 0)
(0 0 0 1)

-------------------------------------------
y' = y*cos q - z*sin q
z' = y*sin q + z*cos q
x' = x

(1 0 0 0)
Rx(q) = (0 cos q sin q 0)
(0 -sin q cos q 0)
(0 0 0 1)
-------------------------------------------
x' = x*cos q - y*sin q
y' = x*sin q + y*cos q
z' = z

( cos q sin q 0 0)
Rz (q) = (-sin q cos q 0 0)
( 0 0 1 0)
( 0 0 0 1)
--------------------------------------------

Developer of Space Chips, pianobasic, zipzapzoom, and vet pinball apps. Developed the tiled map engine seen on the showcase. Veteran for the military.