|
"onur yasarlar" <yasarlar_onur@hotmail.com> wrote in message <hmdqrg$fvh$1@fred.mathworks.com>...
> hi everyone;
> i'm new at matlab so my question will be very easy to answer.
> i want to draw a cube with some edge value and then rotate the cube about x and z axis (ex: for x:30degree, for z:40 degree).
> i tried to write a transformation matrix to multiply but i could not figure it out.
> in the forum i found a for loop with patch command to do create a cube but i couldn't understand the code.
> please help;
>
> best regards...
Remember to use the rotation matrix for each dimension, for example:
suppose that v is the matrix for 8 vertices of the cube, rx, ry, rx is the rotation matrix responsible for Ox, Oy, Oz. Do this iteration:
v = v*rx;
v = v*ry;
v = v*rz;
Regards.
|