Orbit3d

버전 1.0 (39.4 KB) 작성자: Markus Leuthold
3d orbiting camera control for Matlab uiaxes
다운로드 수: 6
업데이트 날짜: 2023/9/14

Orbit3d for Matlab

User-friendly, feature rich replacement of Matlab's cameratoolbar

Matlab lacks a powerful and user friendly interactive tool to handle 3d objects in a plot. Matlab's own cameratoolbar doesn't allow to zoom in/out with the scroll wheel, does not set the light properly and has a quite esoteric orbit function. Furthermore, as of Matlab 2022a, cameratoolbar does not support the new web-based uiaxes

This toolbox implements a quaternion based 3d orbit. Multiple axes are supported, thanks to a newly implemented per-axes (rather than Matlab's own per-figure) event handler. Both the old java based and the new web based figures/axes are supported.

Features

Event Action
Left-click & move Rotate objects
Double-click Set rotation center
Right-click User defined callback
Scroll wheel Zoom towards to/away from mouse pointer
Key r Reset view
Key t Toggle transparency of selected obj
Key w Toggle wireframe of selected patch
Key c Toggle color of selected obj
Key h Show help

Example code

hFigure = uifigure("Name", "Orbit3d (Press h for help)");
hAxes = uiaxes(hFigure);

% enable 3d orbit on the axis
gfx.orbit3d(hAxes);

% load & plot sample mesh
mesh = load('trimesh3d');
hPatch = patch("parent", hAxes, ...
    "Vertices", [mesh.x mesh.y mesh.z], ...
    "Faces", mesh.tri, ...
    "FaceColor", "y");

Please find more examples in the folder examples about the following topics

  • Simple 3d orbit
  • Multiple uiaxes
  • Per-figure and per-axes callbacks
  • gca/gcf/clf/cla replacements for uiaxes/uifigure containing a 3d orbit

Installation

addpath('src')

or, if you use ToolboxToolbox

tbUse('Orbit3d')

Keywords

Matlab, interactive, orbit, orbit3d, 3d, quaternion, geometry, rotation, axes, uiaxes, figure, plot, visualization, patch, mesh, graphics

Author

Copyright 2022-2023, Markus Leuthold, markus.leuthold@sonova.com

License

BSD-3-Clause (https://opensource.org/licenses/BSD-3-Clause)

View Orbit3d on File Exchange

인용 양식

Markus Leuthold (2024). Orbit3d (https://github.com/githubkusi/Orbit3d/releases/tag/v1.0), GitHub. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2022b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
태그 태그 추가

Community Treasure Hunt

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

Start Hunting!

examples

src/+gfx

src/+gfx/+internal

src/+gfx/+internal/+geometry

src/+gfx/+internal/+geometry/+curve

src/+gfx/+internal/+geometry/+distance

src/+gfx/+internal/+geometry/+intersect

src/+gfx/+internal/+geometry/+pick

src/+gfx/+internal/+math

버전 게시됨 릴리스 정보
1.0

이 GitHub 애드온의 문제를 보거나 보고하려면 GitHub 리포지토리로 가십시오.
이 GitHub 애드온의 문제를 보거나 보고하려면 GitHub 리포지토리로 가십시오.