Rotate an object with makehgtform - zrotate only around the origin

5 vues (au cours des 30 derniers jours)
Maor Levy
Maor Levy le 2 Mar 2013
Hey everyone,
I'm trying to use a slider and rotate a sphere. It works if the sphere is in the origin. but my sphere is at point (2.5,2.5,7.5) when I rotate it, the entire sphere rotates still around the origin. I want it to stay in the point and just spin.
My code: this is my slider function
function slider_callback1(hObject, eventdata)
s1 = get(slider, 'value');
R1 = makehgtform('zrotate', s1);
set(t1, 'Matrix', R1);
drawnow;
end
Where
t1 = hgtransform;
set(sphere_1, 'Parent', t1);

Réponses (0)

Catégories

En savoir plus sur Object Containers dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by