Changing the center of rotation of a 3D object

11 次查看(过去 30 天)
Hello,
I want to change my center of rotation of a 3D object that is attached down below. I would like to know how to change the center of rotation of the 3D object, in this case, I would want to be one center in the shoulder and the second one in the middle of the body. In that way when I rotate a separate object, in this case, the torso, the shoulder should follow the movement but I also want that the shoulder moves by itself only if the torso is not moving.
Thank you for your attention,
Ps: I attached the code and an image

回答(1 个)

Priyanka Rai
Priyanka Rai 2020-12-28
rotate(h,direction,alpha) -rotate object about specified origin and direction.
rotate(...,origin) - specifies the origin of the axis of rotation as a three-element vector [x0,y0,z0].
So, make a new 3D vector to define the origin. Then add it as the fourth input parameter.
hSurface = surf(peaks(10));
direction = [1 2 3];
origin = [0 0 0]; %set origin of axis of rotation to plot origin instead of the center of object
rotate(hSurface,direction,20,origin); %add the vector to the parameters
You can use this reference for further details:

类别

Help CenterFile Exchange 中查找有关 Interactions, Camera Views, and Lighting 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by