64 questions
Advice
0 votes
0 replies
32 views
Is there a way for Pointer Lock API to restore the cursor to its natural position after unlock?
I’m implementing drag interactions that need to continue when the pointer leaves the browser window, so I use Pointer Events with `setPointerCapture()` and, in some cases, the Pointer Lock API. During ...
0 votes
0 answers
142 views
Updating HTML element causes PointerLockControls to stutter in three.js
For quite some time, I've had an issue in three.js where when putting any HTML element updates in my animation loop, my PointerLockControls always have a strange stutter. For example: function animate(...
1 vote
1 answer
143 views
how can i add ThreeJs PointerLockControl on mobile version
i'm building a ThreeJs school project and i need to add a mobile version of PointerLockControl i had search "pointerLockControls mobile version" on google but i don't found anything. can you ...
-1 votes
1 answer
345 views
PointerLockControls.js - TypeError: Cannot read properties of undefined (reading 'lock') at HTMLDivElement
I'm extremely new to Javascript and Three.js (and to posting on stackOverflow). I'm attempting to implement a first person camera using three.js by converting the example implementation of ...
0 votes
1 answer
638 views
How to use third person like controls using PointerLockControls?
I'm trying to create a third-person game like this one using three.js. The code for the above demo looks like this - let anchor = new THREE.Object3D() // anchor = character anchor.position.y = 10 // ...
3 votes
0 answers
262 views
Pointer Lock but without message like in Figma when dragging to set width
Edit: Question is resolved. See my first comment. I'm looking to achieve some pointer lock behaviour like this but without the Press [esc] to show your cursor message, or via some hacky workaround or ...
0 votes
1 answer
520 views
Cannot read properties of undefined (reading 'getHex’) when trying to combine webgl_interactive_cubes with pointer lock three.js
I’m trying to create scene with walk-navigation, with interactive objects, for educational purpose. I’m using Pointer Lock Control example for a walk navigation and interactive cubes example from ...
0 votes
0 answers
90 views
Prevent mouse pointer events interfering with simulated events
I am trying to simulate mouse events to perform an action in the DOM like making a selection by moving the pointer from point A to pointer B. Here is an example of the event that I am using. const ...
-1 votes
1 answer
326 views
Change mouse position in p5(with pointer lock api)
I want to make the mouse go to the center of the screen every time it hits the border in p5 but i dont know how to change the mouse position, is there a way to do that with pointer lock api?
0 votes
0 answers
259 views
Why is checking raycast intersections so slow in Three.js?
I'm making an FPS game using Three.js. Take a look at this code: let raycaster = new THREE.Raycaster(); raycastTargets = [otherPlayer]; center = new THREE.Vector2(0,0); function animate() { ...
2 votes
0 answers
185 views
Does Android WebView Support for requestPointerLock()?
I am trying to use requestPointerLock from Javascript on Android. I got some errors when trying the most basic things, so I tried out some examples like this or this don't work. At the same time, I ...
1 vote
0 answers
217 views
Locking the pointer to elements in a vscode extension webview panel throws an error
I am building a vscode extension that creates a webview panel. This panel uses threejs to render a 3d scene - this happens successfully. Unfortunately, no matter what I try, I cannot get the pointer ...
1 vote
0 answers
23 views
Is there a way to implement pointerlock in a scene exported from blender?
On ThreeJS website, in the example misc_controls_pointerlock, the scene is built with geometries written directly in the code. Is there a good way to implement this pointerlock in a model of a room ...
0 votes
1 answer
231 views
pointerLockElement return null when called immediately after requestPointerLock() function
PointerLockElement returns null when called immediately after requestPointerLock() function domElement.onclick = () => { // requestPointerLock() needs to be called by user input domElement....
3 votes
1 answer
1k views
How to activate PointerLockControls only when clicking a button?
I am using the "PointerLockControls" class and I would like to be able to disable the mouse lock when I am in my menu. I want the only way to lock the mouse is to press the button for that. ...