Question:

What are the rotation formulas for a cube?

by  |  earlier

0 LIKES UnLike

I have a point (x,y,z)

Suppose I make a 1 by 1 by 1 cube by making eight points at

x -.5, y-.5, z-.5

x +.5, y-.5, z-.5

x -.5, y-.5, z+.5

ect

what would the formulas be for rotating this cube around the axises of the original point x,y,and z in any combination? (its position on the coordinate plane are totally irrelevant for the program i'm using.)

 Tags:

   Report

1 ANSWERS


  1. If you are using matrix multiplications, do a search for "matrix transformations 3-d rotation".

    If not, then these formulae should suffice:

    Rotation about the Z axis:

    x' = (x * cos(a)) + (y * -sin(a))

    y' = (x * sin(a)) + (y * cos(a))

    z' = z

    Likewise, a rotation around the Y axis keeps the Y value alone, but involves trig functions on the X and Z values.  Here's the function list for rotating around the Y axis:

    x' = (x * cos(a)) + (z * sin(a))

    y' = y

    z' = (x * -sin(a)) + (z * cos(a))

    ... and rotation about the x axis uses a similar set of functions.

    x' = x

    y' = (y * cos(a)) + (z * -sin(a))

    z' = (y * sin(a)) + (z * cos(a))

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.