polyscope icon indicating copy to clipboard operation
polyscope copied to clipboard

Set home view to 180 degree rotation from default?

Open alecjacobson opened this issue 4 years ago • 3 comments

I know that I can set the camera view lookat, but then I have to figure out the center position etc. etc. I like that the home view is data dependent and has a natural default. Unfortunately, most of the models I have are facing backward. Is there an easy way to set the home view to have the z-axis pointing the other way? (rotate by 180 around Y)

libigl vs polyscope on libigl/tests/data/bunny.off image

alecjacobson avatar Dec 23 '21 00:12 alecjacobson

Hmmmm good question. There's not really any easier way to do this now. And in particular, there's nothing that would "persist" in the sense that it would take you back to the view you've selected if you e.g. clicked Reset View.

Perhaps we could add a config setting much like up direction Z_up setting, there could be a corresponding forwardDir choice?

nmwsharp avatar Dec 23 '21 03:12 nmwsharp

The view matrix is a glm::mat4 at polyscope::view::viewMat, you could always just multiply it by a rotation matrix at startup or something or something.

There is some logic that lazily waits to initialize the view matrix until there is some data in the scene, so I thiiiiiink you want to call polyscope::view::ensureViewValid() before messing with the view matrix.

nmwsharp avatar Dec 23 '21 04:12 nmwsharp

thanks. I'll try that for now.

alecjacobson avatar Dec 23 '21 04:12 alecjacobson

There is now a polyscope::view::frontDir variable which sets the default front viewing direction, and as of commit da965d3 the default is changed to ZFront as mentioned above. Thanks for filing the issue!

nmwsharp avatar Mar 26 '23 22:03 nmwsharp