Changing the center of rotation of a 3D object

10 visualizzazioni (ultimi 30 giorni)
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

Risposte (1)

Priyanka Rai
Priyanka Rai il 28 Dic 2020
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:

Categorie

Scopri di più su Visual Exploration in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by