Changing the center of rotation of a 3D object
    11 views (last 30 days)
  
       Show older comments
    
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 
0 Comments
Answers (1)
  Priyanka Rai
    
 on 28 Dec 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:
0 Comments
See Also
Categories
				Find more on Interactions, Camera Views, and Lighting in Help Center and File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
