フィルターのクリア

Changing the center of rotation of a 3D object

15 ビュー (過去 30 日間)
Adriana Dasier Marchena Garcia
Adriana Dasier Marchena Garcia 2020 年 12 月 1 日
回答済み: Priyanka Rai 2020 年 12 月 28 日
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 Center および File ExchangeVisual Exploration についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by