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

questions on screen controls #1

Open
andrea-bistacchi opened this issue Apr 20, 2020 · 5 comments
Open

questions on screen controls #1

andrea-bistacchi opened this issue Apr 20, 2020 · 5 comments

Comments

@andrea-bistacchi
Copy link

andrea-bistacchi commented Apr 20, 2020

Hello, I really like the screen-controls interaction for desktop PC, and I would like to use it for a scientific outreach data visualization project. What is important for my project is to be able to precisely move in 3D with the arrows (or keyboard), and then look around the scene by dragging the mouse, in a sort of "Google Earth" style.

I have a few questions:

  • Is it possible to use keyboard arrows (instead of WASD plus RF) for movement? Particularly the four up/down/left/right arrow for horizontal movement and page up/page down for flying up and down? This would make things more intuitive and also more compatible with different international keyboards that have keys placed in different ways.

  • On tablets and smartphones I would like to disable the sensors and simply drag one finger on the screen for rotating the look direction (so exactly the same as on a desktop, minus the keyboard). This is useful when e..g students have their tablet placed on a desk and you don't want the whole classroom standing and moving around like mad people.

  • Interaction with objects, e.g. to interrogate them and show some information as text and/or an image, could be done with double clicks or double-taps. Do you have an example of this?

  • I imagine that putting the fly-up/fly-down arrows in the lower-left corner (instead of upper left) is easy. Which is the relevant parameter?

  • In any case, how shall I modify your example to add my data, that come as a collection of textured OBJ files stored in a folder?

  • Finally, I see that the WASD arrow result in movement in the original reference frame. Maybe it would be more intuitive to move according to your look direction, so W would be associated to the direction where you are looking at, etc. Would this be possible? Note that I think that this behavior should be limited to movement in the horizontal plane, and fly-up/fly-down should not be influenced by the look direction (it would become a bit confusing).

I really thank you very much!

@andrea-bistacchi
Copy link
Author

An additional requirement in my project would be to have a list or a menu of "3D bookmarks" that would act as a sort of guide to navigate a scene in a predefined way (still being able to navigate freely as discussed above) and follow a "guided tour" related to some teaching activity.

Thanks again very much!

@andrea-bistacchi
Copy link
Author

Another update... I have seen that horizontal navigation in the environment example already works as outlined above: you can use the keyword arrows (in addition to the WASD keys), and pressing the up arrow (or W) makes you move forward in the direction you are looking at. So this can be easily done! What is the relevant parameter to activate this behavior?

Thanks again!

@stemkoski
Copy link
Owner

Hello! This particular example is still a work in progress -- the look-controls still aren't quite aligned with the controls. I'll close this issue once it is ready for deployment.

  • Yes, you can configure the keys -- look at the extended-wasd-component.js file to see the attribute settings you need to change.

  • Clicking on objects in 3D space is tricky. Try an internet search for this topic and you'll see what I mean.

  • Changing the position of the on-screen buttons is just a matter of rearranging the div elements.

  • WASD is meant to move in the direction you are looking at. It's currently broken. Will close this issue when fixed.

  • The environment example uses the default wasd-controls associated to the default camera, that's why arrow keys work automatically with that.

Regarding your other questions, those really have nothing to do with the screen-controls component; it sounds like you need some assistance with a-frame development in general. Perhaps stackoverflow.com would be a better place to reach out to a wider audience?

@andrea-bistacchi
Copy link
Author

Hi and thanks very much for the quick answer! It points to three more focused questions:

  1. It seems I should use, at least for the moment, the default WASD-controls associated to the default camera. Does this turn off the sensor-based control on tablets and smartphones and make them behave as a PC? Is there an option for this? Could you point meto an exampleof this? I ask because it seems that in standard AFrame the controller auto-detects the device and changes behaviour in a way I do not consider efficient for my project.

  2. What is, in your screen-controls example, the part of the code that associates the on-screen arrows to WASD keys? It appears that in this example there are also other thinks, not completely developed, like the maximize screen stuff, and it is not completely clear (to me) what part of the code I really need.

  3. I understand that "clicking in 3D" is done with some sort of "laser pointer". Probably this could work also with a double click or double tap. Could You point me to some good example?

  4. Do you have also good examples with "guided tours" based on 3D bookmarks?

Thanks very much again and sorry for my limited experience with AFrame (I am more experienced in Python and scientific computing in general).

@Wulff2099
Copy link

Hello is posible to make an exaple where the screen controls move an gltf model instate of the camera.
I try to do it but i faild :(
Thanks a lot

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

3 participants