I’m having some problems with raycasting objects. My scene is being a part of my viewport so I placed my scene in a div. I managed to align the raycaster by using “pageX” instead of “clientX” and then to calculate the offset which was working fine the only problem is that when the viewport is being zoomed in or out the offset is going out of sync again.
I have no idea how I can fix this problem, so any pointers into the right direction are very welcome. Thanks