Rotations can take place in different spaces. Ie: object-, World- space.
If i rotate an object it rotates it arround its object-space axis. What happens if i want to rotate an object on world-space axis?
Can any one help give me a solution that will rotate a object in world space by acting on its object space Roll, Pitch and Yaw?
Ill try and explain better if anyones confused. I cant think yet of how to do this!
Can any one solve this problem?
-
- New User
- Posts: 5
- Joined: Fri May 28, 2004 9:10 pm
Can any one solve this problem?
Intuition is the holy grail!
...,
Not sure it will be a one shot answer : the following code sample shows how to transform step by step a X, Y, Z point in a XR, YR, ZR resulting point after rotating it according to the given angle around the given axis.
You may use such transform code in procedures to apply transformations on a parametric 3D point.
This will rotate a given point around a given axis, and by combination around all axis.
Then, if you want to apply the rotation to a set of points using a given rotation center, you have to apply Sin / Cos functions to the distance from each point to a C(CX, CY, CZ) point. That is to say each x, y, z is to be changed to (cx - x), (cy - y) and (cz -z).
So if you miss a rotate function to apply on a set of points, vectors or anything, you will have to calculate points coordinates by yourself using such a stuff.
It can look tricky to do, but it generally calculates fast and gives nice rendering.
;
; Rotate X
;
XR = X
YR = Cos(angle_x) * Y - Sin(angle_x) * Z
ZR = Sin(angle_x) * Y + Cos(angle_x) * Z
;
; Rotate Y
;
XR = Cos(angle_y) * X + Sin(angle_y) * Z
YR = Y
ZR = -Sin(angle_y) * X + Cos(angle_y) * Z
;
; Rotate Z
;
XR = Cos(angle_z) * X - Sin(angle_z) * Y
YR = Sin(angle_z) * X + Cos(angle_z) * Y
ZR = Z
Not sure it will be a one shot answer : the following code sample shows how to transform step by step a X, Y, Z point in a XR, YR, ZR resulting point after rotating it according to the given angle around the given axis.
You may use such transform code in procedures to apply transformations on a parametric 3D point.
This will rotate a given point around a given axis, and by combination around all axis.
Then, if you want to apply the rotation to a set of points using a given rotation center, you have to apply Sin / Cos functions to the distance from each point to a C(CX, CY, CZ) point. That is to say each x, y, z is to be changed to (cx - x), (cy - y) and (cz -z).
So if you miss a rotate function to apply on a set of points, vectors or anything, you will have to calculate points coordinates by yourself using such a stuff.
It can look tricky to do, but it generally calculates fast and gives nice rendering.
;
; Rotate X
;
XR = X
YR = Cos(angle_x) * Y - Sin(angle_x) * Z
ZR = Sin(angle_x) * Y + Cos(angle_x) * Z
;
; Rotate Y
;
XR = Cos(angle_y) * X + Sin(angle_y) * Z
YR = Y
ZR = -Sin(angle_y) * X + Cos(angle_y) * Z
;
; Rotate Z
;
XR = Cos(angle_z) * X - Sin(angle_z) * Y
YR = Sin(angle_z) * X + Cos(angle_z) * Y
ZR = Z
My avatar is a small copy of the 4x1.8m image I created and exposed at 'Le salon international du meuble à Paris' january 2004 in Matt Sindall's 'Shades' designers exhibition. The original laminated print was designed using a 150 dpi printout.
-
- New User
- Posts: 5
- Joined: Fri May 28, 2004 9:10 pm
I think my post was a little confusing maby! I'll tryn explain it again (better!).
A rotation applyed to a model will act upon its object space axis. How can i emulate it being rotated around the world space axis but only by applying any rotations to the object space axis when i know its current roll, pitch, yaw?
Damn
! I just cant explain it clearly!
maby ill have to come back with some illustrations.
A rotation applyed to a model will act upon its object space axis. How can i emulate it being rotated around the world space axis but only by applying any rotations to the object space axis when i know its current roll, pitch, yaw?
Damn


Intuition is the holy grail!
-
- New User
- Posts: 5
- Joined: Fri May 28, 2004 9:10 pm
btw, fweil-
that rotation system's realy cool huh. Iv used it before when i was experementing with software rendering.
I optimised it by setting a rotation space function that calculated and stored the Sin and Cos of the Roll, Pich and Yaw. -
Then when i needed to transform a point i just used the precalculated values.
Just in case anyone caired. thanks tho
that rotation system's realy cool huh. Iv used it before when i was experementing with software rendering.
I optimised it by setting a rotation space function that calculated and stored the Sin and Cos of the Roll, Pich and Yaw. -
Then when i needed to transform a point i just used the precalculated values.

Intuition is the holy grail!
-
- User
- Posts: 17
- Joined: Sun Apr 25, 2004 9:12 pm
- Location: Europe, Belgium