create3000 / x_ite

X_ITE X3D Browser, view and manipulate X3D and VRML scenes in HTML.
https://create3000.github.io/x_ite/
Other
67 stars 15 forks source link

Question: Where is the user interface for interacting with the viewer documented? #150

Closed gwhitney closed 1 year ago

gwhitney commented 1 year ago

My apologies if I missed something I should have seen, but where can I find documentation on how the person looking at a scene manipulates the view? It seems that the widget always starts in the "examine viewer," where as far as i can tell all you can do is rotate the view by clicking and dragging, and the view responds more or less like a trackball. I see there are several other viewers. In the walk viewer my objects always seem to go out of frame and not come back; in the fly viewer I seem to be able to pan a bit but the response to dragging around is counterintuitive to me. Is there anywhere a description of all the viewers (which I think of as "viewing modes") and what the available controls and behaviors are in each? That would be very helpful, thank you.

gwhitney commented 1 year ago

P.S. I would ideally like a view that I can rotate, pan (by which I mean translate my viewpoint), and zoom, much like in Blender or FreeCAD. Is there such a mode, and if so what are the controls to do each of those things?

create3000 commented 1 year ago

I have added a new page to the documentation describing how all viewers work.

https://create3000.github.io/x_ite/tutorials/how-to-navigate-in-a-scene

gwhitney commented 1 year ago

Thanks! That's extremely helpful. I looked at the NavigationInfo node and I see the customization options. Setting which button and/or modifier keys select which action (to emulate other software like Blender/FreeCAD etc.) does not seem to be on that list. There isn't some other way it's possible, is there? (Fine if not, I just want to know what facilities I can offer, thanks.)

create3000 commented 1 year ago

The keys which are described in the documentation cannot be changed, the are more or less standardized in the X3D specification.

See: https://www.web3d.org/documents/specifications/19775-1/V4.0/Part01/components/navigation.html#NavigationInfo

gwhitney commented 1 year ago

Great, thanks for the reference. I am assuming when the standard document says

Whether user-selectable alternatives to the Shift, Ctrl, and/or Alt are provided is browser-dependent. If provided, the method by which such alternatives are specified is also browser-dependent.

it means that Chrome or Firefox might provide a way to remap those keys, not the X_ite viewer widget? Alternatively, if it does mean that a widget like X_ite could provide a mechanism for changing them, would there be any interest in a PR implementing some configurability in this respect? Thanks for your thoughts.

create3000 commented 1 year ago

When the standard say 'browser', it means in this case X_ITE, the X3D browser. Changing those keys in X_ITE is currently not provided.

gwhitney commented 1 year ago

Thanks for the clarification. And yes, I understand there is currently no facility for changing the roles of those keys in X_ITE as it stands. I meant to ask whether the maintainers would entertain a pull request affording the user at least some control over them, say just an option in the standard menu that would allow the roles of CTRL and ALT to be swapped. Thanks for your thoughts.

gwhitney commented 1 year ago

Once again, thanks for the navigation documentation; I don't mean to keep this issue open past its time, but I did have one follow-up question, and I thought it would be better to ask here rather than open a new issue. Experimenting, it seems as though the "examine" viewer has only two degrees of freedom. In other words, looking at the basic cylinder displayed on https://create3000.github.io/x_ite/tutorials/building-primitive-shapes, you can spin the cylinder in place (around its axis of symmetry) and you can tip the top of the cylinder toward you or away from you, but there is no way to get the cylinder to lie sidways so that the flat circular end is pointing right or left. Or in brief, you can yaw and pitch, but there's no way to roll. Is that correct, or did I miss something in how to manipulate the viewer? Thanks.

create3000 commented 1 year ago

There is a 'Straighten Horizon' menu item in the context menu, when enabled it constrains the view, so that the horizon is always horizontal, when disabled there are no such constrains and navigation feels more freely.

There is also a browser option 'StraightenHorizon' which can be read and written, see https://create3000.github.io/x_ite/reference/browser-services#string-getbrowseroption-string-name.

gwhitney commented 1 year ago

Oh, and turning off "Straighten Horizon" also gets rid of the gimbal lock at +- 90-degree pitch. Much better! Thank you.

gwhitney commented 1 year ago

P.S. Incidentally, x3dom uses "ctrl" for panning in its examine viewer. So I guess those authors didn't feel the specification was so strict about which modifier key should be which.

create3000 commented 1 year ago

With X_ITE there is the philosophy, that it should be as close as I can get to the specification, and everything should be implemented if possible.