Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Orientation cube in the viewer #26

Open
codri opened this issue Oct 3, 2020 · 9 comments
Open

Orientation cube in the viewer #26

codri opened this issue Oct 3, 2020 · 9 comments

Comments

@codri
Copy link

codri commented Oct 3, 2020

It would be great to have a classic orientation cube in the viewer, that would indicate the camera orientation,
as well as allow for easy navigation between the views.

image

Is this a feature you think would be handy for the project?

Thanks

@zalo
Copy link
Owner

zalo commented Oct 4, 2020

This is a good idea; I'll have to think about the best way to implement it.

zalo added a commit that referenced this issue Oct 4, 2020
This PR begins adding a View Cube at the request of #26.

After this quick and dirty implementation, I'm not totally convinced the additional complexity and state are worth it.  The camera movement functionality isn't necessary in a SCAD app, given the drawing occurs entirely from the code-editor and not the graphical editor.

I may downgrade this to a simple orthonormal basis (to provide a quick reference for which direction is which).
@zalo zalo mentioned this issue Oct 4, 2020
@zalo
Copy link
Owner

zalo commented Oct 4, 2020

Did a test implementation that you can try here, and after considering the added complexity:functionality trade-off, I might just split the difference and render a non-interactive orthonormal basis as a simple reference for scripting coordinate calculations.

@codri
Copy link
Author

codri commented Oct 4, 2020

That was quick. Looks good. The size is a bit large, and the perspective looks a bit odd, probably because of the vertical distiortion.

Also, I would suggest using the labels (-x -> left, x -> right, -y -> back, y -> front, +z -> up, -z -> down) or something similar.
Maybe also worth having the axes along the edges.
image

But overall looks good. Be careful not to burn out with work over the weekend(just a suggestion, you know better what you're capable of).

@johnsonm
Copy link

johnsonm commented Oct 5, 2020

What would you think of having the ability to instead just have X, Y, and Z arrows? I'm used to that in OpenSCAD, FreeCAD, SolidWorks, and IIRC all three put that indicator in a corner; lower left for OpenSCAD and lower right for FreeCAD.

Here's what it looks like in FreeCAD:
image

@codri
Copy link
Author

codri commented Oct 6, 2020

One of the main advantages of the cube is being able to click on a face,
and it would position the camera on top of that plane, thus allowing a faster switch to a 2d view.
But this can also be done with keyboard shortcuts, so I don't know, but I don't have any strong opinions on these.

@johnsonm
Copy link

johnsonm commented Oct 7, 2020

Ah, I'm used to that being a different tool.

Again the FreeCAD version. First, showing a 45⁰ from every axis view:

image

Then a front view after clicking on "Front":

image

You can see that it also incorporates the axis hint graphic.

All the light arrows and tabs at the edges of the cube are clickable to rotate around the 6DOF in 45⁰ increments. At least in the FreeCAD version, the cube can't be directly manipulated, just clicked through standard orientations. I keep trying to grab it to rotate it and instead snapping to a standard view by accident. ☺

@brad-jones
Copy link

brad-jones commented Dec 9, 2020

But this can also be done with keyboard shortcuts

@codri care to share what the keyboard shortcuts are?

@zalo
Copy link
Owner

zalo commented Dec 10, 2020

I don't believe I've implemented view orientation keyboard shortcuts 🙃

I assume, if implemented, the function would be something like a combination of the rotation code from here and the keyboard shortcuts from here.

@borioan
Copy link

borioan commented Dec 10, 2020

I love the idea of using an orientation cube in the viewer!!! It is perfect and rapid option when you need a 2D view of a specific plane (front for example). Can a version be implemented based on an orthographic camera also?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants