When i click the button, i want a mesh to basically follow my cursor until i click somewhere.
However the scene seems to be too small. The cylinder just becomes visible when i move it near another object. So the scene seems to have approximately the size to wrap the displayed objects.
I’d like to set the dimensions of the scene to the whole screen, so i could move my cursor anywhere.
Is it possible to somehow extend the scene dimensions to maximum size?
the scene has no size per se You can move the camera to see a bigger part of it. But technically scene has no limit. It is just the virtual container of meshes + a point of view (the camera)
Well, that makes sense.
The problem seems to be within the scene.pick method then?
I tried logging the position inside the onPointerMove function and when my cursor is far away from the existing objects, “console.log(scene.pick(scene.pointerX, scene.pointerY, null, null).pickedPoint);” will always log “null”. When my cursor is close the existing objects, then coordinates will be printed out.
Is there a way to always get the mouse position, no matter where it is on the screen? I’m kind of confused why it would give me null when its further away.
Instead of attaching the mesh to the mouse, i ended up using the PointerDragBehavior.
I realized its more suitable for my needs and runs super smooth and nice: https://tarrew.gitlab.io/masterprojekt/