curv icon indicating copy to clipboard operation
curv copied to clipboard

Extending "reset view" with more defaults.

Open TLC123 opened this issue 7 years ago • 1 comments
trafficstars

Love the new reset view function. Very useful. I can immediately think of a couple of useful reset alternatives to default views.

  1. Regular stuff like top/bottom, left/right, front/back. Maybe repeated "reset" presses could toggle through them. Maybe single key for each.

  2. All combination of the above projections. like top+front.
    This makes more sense from command-line than as a toggle. Maybe typing up to three letter key combo for each. T, TLF, T F, T R, F, BRB. Nut sure how the shader can catch sequences of key presses though.

Beyond this feature request, but also relevant to the discussion of reseting views. stuff like: -"zoom extents" if !inf , either by bounding box or field samples.

  • Setting default view from command line, This feature makes some sense when launching multiple views of the same file. Older cad style.
  • Possibly iso/perspective, I don't think viewer support this currently. /123

TLC123 avatar Sep 21 '18 18:09 TLC123

I'm not sure about multi-key combinations, or repeated presses of the same key to toggle through states. That sounds a little complicated. However, I would endorse a simple interface that maps single keys onto some of the more useful viewer options in OpenSCAD. For example,

  • T -> top
  • B -> bottom
  • L -> left
  • R -> right
  • SHIFT+F -> front
  • SHIFT+B -> back
  • O -> orthogonal
  • P -> perspective

(Or propose a better key mapping.)

I think that TBLRFB could probably be implemented simply by changing the existing 3D camera variables, same as how the HOME key (reset) works.

The O/P keys would, I think, require somebody who understands the difference between a "perspective projection" and an "orthographic projection". I think changes are required to the 3D rendering code, and possibly the addition of a new uniform variable. There are lots of tutorials on the web that explain these concepts, in the context of OpenGL. Look at the fragment shader generated by -o foo.frag on the command line: the code is in libcurv/geom/frag.cc.

I am not sure what you want the "Zoom Extents" command to do. Isn't that just a command that makes all objects visible? Doesn't the HOME key already do that?

doug-moen avatar Sep 30 '18 23:09 doug-moen