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

Add joystick to Vector3d #431

Open
s4l4x opened this issue Jan 16, 2023 · 8 comments
Open

Add joystick to Vector3d #431

s4l4x opened this issue Jan 16, 2023 · 8 comments

Comments

@s4l4x
Copy link

s4l4x commented Jan 16, 2023

I love the joystick and would love to use it to set a Vector 3d. One way it could work is if we allow the user to set the vector plane by plane and let them quickly change between planes.

Tap the joystick to show the existing 2d joystick applied to a plane. Tap a button to switch planes, or use modifier keys, to quickly switch between them. As an added bonus the joystick grid could rotate to the new plane when switching.

Thoughts?

image

@s4l4x
Copy link
Author

s4l4x commented Jan 16, 2023

I'm not sure of the following:

  • which plane should be the default
  • how to indicate that the other planes can be easily accessed via modifier keys (using the current text and button styles)

@drcmda
Copy link
Member

drcmda commented Jan 16, 2023

beautiful!

@s4l4x
Copy link
Author

s4l4x commented Jan 22, 2023

Draft PR here: #433

I added the 2d Joystick to the Vector3d and it can control an arbitrary pair of dimensions. Next up:

  • Control the dimension pair aka plane with the keyboard
  • Add buttons for the planes

@s4l4x
Copy link
Author

s4l4x commented Jan 23, 2023

Currently looks like this:
image

Next issues:

  • Dragging to the edge "upsets" the values
  • Draw the Joystick buttons below

@s4l4x
Copy link
Author

s4l4x commented Jan 23, 2023

Currently looks like this:
image

Next up:

  • Add dimensionality to the joystick

@s4l4x
Copy link
Author

s4l4x commented Jan 24, 2023

  • Added hotkey labels to the buttons
  • Changed zx to xz so that moving the mouse in x changed the value in x (and not z)
  • Changed the hotkeys to Control and Meta to allow for the simultaneous use of the precision modifier
  • Reordered the buttons to physically match the keyboard
    image

@s4l4x
Copy link
Author

s4l4x commented Jan 26, 2023

  • Added some depth and animation 😇
  • Changed YZ to ZY to shat moving the mouse in y changed the value of y (and not z)
Screen.Recording.2023-01-26.at.18.36.27.mov

@s4l4x
Copy link
Author

s4l4x commented Jan 26, 2023

  • I added comments in the code where I could use help. I'm sure there's more.
  • I also just remembered I'm getting an error in the console regarding validateDOMNesting(...): <button> cannot appear as a descendant of <button>. In effect I'm using buttons, but I'm not really using them as buttons.
  • I'm also wondering how this would work on touch devices (probably more like buttons ;)

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

2 participants