フィルターのクリア

Rotate an object with makehgtform - zrotate only around the origin

4 ビュー (過去 30 日間)
Maor Levy
Maor Levy 2013 年 3 月 2 日
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);

回答 (0 件)

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by