3D Rotation(and Align) about an arbitrary axis

we need several steps to do this job.
1. translate to origin
2. rotate Z
3. rotate Y

64819260_50a870c49c.jpg

Z-Axis Rotation
x’ = x*cos q – y*sin q
y’ = x*sin q + y*cos q
z’ = z

X-Axis Rotation
y’ = y*cos q – z*sin q
z’ = y*sin q + z*cos q
x’ = x

Y-Axis Rotation
z’ = z*cos q – x*sin q
x’ = z*sin q + x*cos q
y’ = y

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: