-
Notifications
You must be signed in to change notification settings - Fork 33
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
Example to target objects other than Dat gui ? #11
Comments
Hi @danrossi. VRController has no raycasting routines—that’s an additional layer for you (the developer) to add, tuned to your own needs. The DAT GUI (Data Arts Team Graphic User Interface) is one such additional layer that can do this. But if there’s a big want for this functionality to be merged into VRController that might be a fun thing to add. In the meantime, here’s an example that uses a ton of raycasting to target objects: Space Rocks. Check out the Space Rocks repo. The way it works is that the controller fires plasma bolts and those bolts raycast to see if they are hitting something. You might also be interested in And in |
Ok thanks for that I tried to decipher what its doing but can't. It doesn't need to be built in but on the example. I guess what is needed is a laser line or reticle that moves with the controller object. Which can be used for the Raycaster ? Much like the native controller in GearVR. |
I guess what I am talking about is a demo integration like the original controller in three.js. It uses a laser object to use as the RayCaster. I am just a little not sure how to replicate this controller over. |
Possibly ok to close unless a second demo is needed. I kind of have something to work with now. This laser line can be used for intersect. And I guess it will only intersect if the button is pressed.
This adds a line that extends the controller model. The line needs to thin out like the native one does, and it needs to change position when hitting an intersect object. |
Here is something on the lines I mentioned. The raycast is hitting just under the object however. I can get it to change colour on button press. https://github.com/danrossi/THREE.VRController/blob/master/raycast.html |
I've updated the example to reposition the line distance to the intersect object. However it detects an intersect at an offset underneath the box. Any ideas what could cause this in the controller ? Is there an offset that needs to apply to the raycaster ? If I direct the line to a region underneath the box it will detect a click and hit properly. |
Closing and starting again. I have the raycaster partially working but there is a problem. |
I can't seem to find an example here to get the controller clicking objects with a raycaster. It for some reason is using Dat gui only.
Any ideas ?
The text was updated successfully, but these errors were encountered: