Rotate an object with makehgtform - zrotate only around the origin
2 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Object Containers についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!