“look at” add-on to legacy Visualizer/ViewControl #7023
cwreynolds
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Just in case this might be useful to anyone else, here is a function to provide “look at” (look-from, look-at, up) functionality while using the legacy classes
open3d::visualization::Visualizer
andopen3d::visualization::ViewControl
.I used this as a work around when I ran into problems using the newer
open3d::visualization::visualizer::O3DVisualizer
from c++ on macOS, see #7000This function is similar (I think) to
open3d::visualization::visualizer::O3DVisualizer::SetupCamera(fov, center, eye, up)
but does not set fov. It alters aVisualizer
’sViewControl
using theConvert[To/From]PinholeCameraParameters()
API and a transform computed byopen3d::visualization::gl_util::LookAt()
.If you are still reading at this point, I am curious about that unexpected negation (
pcp.extrinsic_ = -la_matrix
). Can anyone explain how/why that is needed?Finally as just a little context and eye-candy, this is how I am using it to provide a “follow camera” for a simulation of agents moving in a 3d environment. This is a boids model being used as a loss function in an optimization procedure acting on the flock parameters.
20241021.follow.cam.sample.mov
Beta Was this translation helpful? Give feedback.
All reactions