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

Create a pickable component example #258

Open
vincentfretin opened this issue Mar 6, 2021 · 6 comments
Open

Create a pickable component example #258

vincentfretin opened this issue Mar 6, 2021 · 6 comments

Comments

@vincentfretin
Copy link
Member

Create an example where you can grab a cube with laser-controls with a simple pickable component inspired from https://github.com/wmurphyrd/aframe-super-hands-component/blob/master/reaction_components/grabbable.js#L40-L70 without any dependencies, without physics. See discussion at #223

@vincentfretin
Copy link
Member Author

Maybe such component already exists somewhere?

@vincentfretin
Copy link
Member Author

@PlumCantaloupe I found https://github.com/extraymond/aframe-mouse-dragndrop
look at the live demo here https://sassy-piper.glitch.me and the code https://github.com/extraymond/aframe-mouse-dragndrop/blob/master/src/index.js
You can move the blue box with the mouse cursor and use the mouse wheel to define the depth too.

@vincentfretin
Copy link
Member Author

This may be a nice addition to the "Ownership Transfer" example where you can spawn a cube with space (you need to move back a little to see it, this would maybe be good if it spawned one meter in front of the camera)

@vincentfretin
Copy link
Member Author

We may just modify the "Ownership Transfer" example like this:

  • use <script src="https://cdn.jsdelivr.net/npm/aframe-mouse-dragndrop-component@latest/dist/index.js"></script>
  • add dragndrop to the spawned cube
  • spawn the cube with space 1 meter in front of the camera
  • use click on a cube to take ownership, instead of pressing enter to take ownership of all spawned cubes

If anyone is interested in contributing this, PR welcome.

@vincentfretin
Copy link
Member Author

see also #238

@kylebakerio
Copy link
Member

I've long that an example like this should exist here.

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

No branches or pull requests

2 participants