I need an object/group to rotate by following the current mouse position while it moves.
The user can drag the red cone and move mouse around. The group which consists of the cone, the ‘main figure’ and the 2D text should move such that the cone always looks at the current mouse position.
My code to achieve this is like this but the rotation behavior is not optimal as the rotation is not “smooth”:
this.raycaster.setFromCamera(pickPosition, this.camera); let intersect = this.raycaster.intersectObject(this.scene.ground); const directionVector = intersect.point.clone(); directionVector.y = 0; userObject.lookAt(directionVector);