aframevr / aframe-inspector

:mag: Visual inspector tool for A-Frame. Hit *<ctrl> + <alt> + i* on any A-Frame scene.
https://aframe.io/aframe-inspector/examples/
MIT License
654 stars 201 forks source link

Unable to rotate objects when looking straight at them #564

Open Drugges opened 5 years ago

Drugges commented 5 years ago

When you select the rotate tool and place the object so you look straight at it, you will not be able to rotate it in all directions. I think it is because the TransformControls add helper planes when you press down the mouse button. And if you look straight at an object, some of the helper planes will be placed so they are rotated towards you so they are not visible. You can see an example below. I have added colors to the helper planes to show you what I mean. In the first image I have placed the object a little bit to the left. You are then able to see the helper plane and you are able to rotate the object using the red slider. But if you look at the other image, I have placed the object in the middle of the camera. The plane is still there, but since it is rotated towards you it won't be able to rotate using the red slider.

capture-1 capture-2

Drugges commented 5 years ago

I came up with a half working work-around: I add another plane to the TransformControls when we click on a handle button but don't intersect a plane. My new plane is placed a bit in front of the node, and rotated so that it looks towards the camera. I can then use this plane for detection instead. It works pretty well. I haven't tested all edge cases yet though.