# 3D Matrix Orientation issue

1. Feb 9, 2010

### Ya-Nvr-No

I am attempting to write a C++ routine that will take a rectangle cube 3"x 2"y 1"z and rotate it by 90 degrees at a time. It then should display what side and direction it is in. Just how do you tell what side and orientation it is in? Seems like depending on what direction I go it gives me different results using the euler matrix. 6 sides 4 directions each gives me a multiple of 24 possible outputs. But going in different direction gives me incorrect results.

I have created a spreadsheet to help with the 3d matrix programming. Thought others might like it and make it better. Please re-post the results or enjoy. Either way please help me understand how I can tell what face I am looking at.

My use is for spindle to workpiece orientation. If I rotate the spindle orientation from vertical to horizontal. I have a new face orientation, to place the workpiece cube zero point in the correct orientation I will need to spin the block around. Keeping track of these is confusing.

There must be away in the matrix to compute the orientation. Or do I use a new matrix to compute the sine cosine components and keep track of the directions the cube is spinning?

(directions up, rotate left, rotate right, down)
A = top side
B = front side
C = left side
D = back side
E = right side
F = bottom side

Thanks for any help

File size:
23.5 KB
Views:
34