Arcball like 3D figure rotation

버전 1.0.0.0 (2.24 KB) 작성자: Andrea Tagliasacchi
Example that shows how to add arcball control to a 3D window
다운로드 수: 1.9K
업데이트 날짜: 2008/5/13

라이선스 보기

One of the major drawbacks of matlab is the lack of a way of changing the viewpoint of a 3D mesh using a natural (arcball) interaction.

In this simple function I demonstrate the arcball interaction allowing a 3D sphere to be moved naturally. Run the function and drag and drop with your mouse on the sphere surface.

A very important aspect that you should note is that I am rotating the ACTUAL 3D object instead of the viewpoint.

There is a specific reason for this choice. The OpenGL lighting is linked to the axis in matlab, thus, if you rotate the veiwpoint, the lighting on the mesh surface wouldn't change. On the other hand, if you rotate your object using hgttransoforms you achieve this result.

It is now apparently bug-free :)

인용 양식

Andrea Tagliasacchi (2024). Arcball like 3D figure rotation (https://www.mathworks.com/matlabcentral/fileexchange/19760-arcball-like-3d-figure-rotation), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2008a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0.0

Corrected a bug in the rotation direction update which caused the "bug".

Now it works nicely.