Rotate an object with makehgtform - zrotate only around the origin

5 visualizaciones (últimos 30 días)
Maor Levy
Maor Levy el 2 de Mzo. de 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);

Respuestas (0)

Categorías

Más información sobre Object Containers en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by