Re: Convert axis and angle of rotation to rotations about X & Y axis'



On 14 Dec 2005 06:45:11 -0800, ericgorr@xxxxxxxxx wrote:
>I am only concerned about aim, roll about the aim direction is not
>important for my situation.
>
>Here's a (probably inefficient) possible solution:
>
>I'll work with the 3D coordinate system as pictured here:
>http://mathworld.wolfram.com/SphericalCoordinates.html
>
>I can define a bounding sphere around my object, centered around (0, 0,
>0).
>
>
>a. Convert the axis-angle to a rotation matrix
> (the OpenGL function glRotatef will be useful here)
>
>b. Take the XYZ point (0, 1, 0 ) and apply the rotation matrix to it.
> Call this new point P.
>
>c. Determine the position of P in Spherical Coordinates.
>
>I now have an angle of rotation about the X-Axis (Phi) and an angle of
>rotation about the Z-Axis (Theta) and essentially my answer.

Fine. It appears you want to aim the Y axis using rotations around X
and Z. Steps (a) and (b) are a reasonable way to start. Now you must
decide two things: (1) Do you want to rotate first around X, or around
Z? (2) Do you want use (fixed) world axes or (rotating) body axes?

Assume X first, world axes. Then we have the following

P = [rotate by Theta around Z] [rotate by Phi around X] Y

Reverse this to read

Y = [unrotate by Phi around X] [unrotate by Theta around Z] P

Let the components of P be (x,y,z). Let ct and st be cosine and sine
of Theta; cp and sp, of Phi. Then we require unrotation by Theta to
zero the x component of P:

[0] [ ct st] [x]
[r] = [-st ct] [y]

This is accomplish by letting r = sqrt(x^2+y^2), (ct,st) = (y,-x)/r,
if r is non-zero, else by (ct,st) = (1,0).

Similarly we require unrotation by Phi to zero the z component of P:

[1] [ cp sp] [r]
[0] = [-sp cp] [z]

Notice the y component is already unrotated to be r. Also notice that
r^2+z^2 should equal 1. So we take (cp,sp) = (r,z).

The actual angles Phi and Theta are computed using a two-argument
arctangent function.

.



Relevant Pages

  • Re: Convert axis and angle of rotation to rotations about X & Y axis
    ... >>I am only concerned about aim, roll about the aim direction is not ... Convert the axis-angle to a rotation matrix ... >>rotation about the Z-Axis (Theta) and essentially my answer. ... phi to 60 degrees. ...
    (comp.graphics.algorithms)
  • Re: Huge bug when vectorizing
    ... history of motion, containing, say, N values of Euler angles psi, theta, ... A = matrix(psi, theta, phi) ... If you want to apply the kth rotation to the result of rotating v by the ...
    (comp.soft-sys.matlab)
  • Re: Newbie looking for info on basic graphics with Delphi.
    ... The wireframe itself is of course three-dimensional; for rendering ... \y/ over an angle phi is done by ... Even knowing *why* it can't really do anything else than rotate ... since rotation is about the model's origin, ...
    (comp.lang.pascal.delphi.misc)
  • Re: Einsteins Relativity Disregards the Doppler Effect?
    ... what is phi (did you mean that symbol is a phi and not a theta)? ... speeds of double stars do not affect the aberration angle. ... object emiting the light beam and the light beam always travels at "c" ...
    (sci.physics.relativity)
  • Re: Commutation Relations between L_i , x_i , p_i
    ... and rotating this vector arount the z axis by theta ... It necessarily follows that the same identities are ... Expand the rotation operators to first order in theta: ... manually terminate your lines at 71 characters, or make manual breaks ...
    (sci.physics.research)