Message 1 of 3
Orbit, zoom, pan fundamental viewport controls
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello there I'm working on new input device to work with Fusion 360 via 3rd Addins.
And I'm searching for implementation of fundamental viewport controls (pan, zoom, orbit) in C++.
Does anybody have some idea how to do that? This is my code that does not work 😞
void orbit(Ptr& screenCoordinateCenter, double deltaX, double deltaY) { Ptr camera = app->activeViewport()->camera(); camera->isSmoothTransition(false); Ptr eye = camera->eye(); eye->x(eye->x() + deltaX); eye->y(eye->y() + deltaY); camera->eye(eye); app->activeViewport()->camera(camera); app->activeViewport()->refresh(); } void pan(double deltaX, double deltaY) { Ptr camera = app->activeViewport()->camera(); camera->isSmoothTransition(false); Ptr eye = camera->eye(); eye->x(eye->x() + deltaX); eye->y(eye->y() + deltaY); camera->eye(eye); Ptr target = camera->target(); target->x(target->x() + deltaX); target->y(target->y() + deltaY); camera->target(target); app->activeViewport()->camera(camera); app->activeViewport()->refresh(); }