Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 1
    Ha! I just realized this is almost identical to the answer I gave on an earlier SO question of yours. It really is the same underlying problem though. Commented Dec 28, 2015 at 22:52
  • Thanks for your answer! I know, I seem to have the same underlying problems all the time. ;-) Your example does what I was looking for but is it a good practice to add the ball to the scene and the ball to the pivot on every click? I saw that on the floor there are the shapes appearing again. Commented Dec 30, 2015 at 3:34
  • I applied your code to my example, but I have an issue (with the position of the pivot). If you would like to take a look here: dev.ideaspacevr.org/photos Your code is in dev.ideaspacevr.org/includes/js/aframe/components/hud.js In the last statement the camera's position is always 0 0 0. Could this be an aframe issue? Thanks! Commented Dec 30, 2015 at 4:08
  • Looks like the camera object is actually part of the scene in A-frame. You could either use this.el.sceneEl.cameraEl.object3D.getWorldPosition() or add the pivot to the camera instead of the scene. Commented Dec 30, 2015 at 6:12
  • Thanks a lot! getWorldPosition() did the trick, I should have thought of that myself. Commented Dec 30, 2015 at 14:35