- This topic has 5 replies, 3 voices, and was last updated 2 years, 10 months ago by ma77hew.
-
AuthorPosts
-
2019-12-06 at 6:23 pm #21789Branden CokerCustomer
I have an orbit camera set to a fixed distance. My scene can be rotated but doesn’t allow zooming. When I use my scroll wheel in my browser I would like the page to scroll, but currently nothing happens. Is there a way scroll the page with the wheel when it isn’t needed for zooming?
2019-12-09 at 8:44 am #21832Ivan LyubovnikovStaffHi Brandon,
This can be solved only by using javascript API. It’s a simple code snippet, which you can add for example in the standard runCode() function in your application’s js file:
function runCode(app) { if (app.controls) { app.controls.enableZoom = false; } }
– this should completely disable zoom and bring page scrolling back
Co-founder and lead developer at Soft8Soft.
2019-12-09 at 5:43 pm #21850Branden CokerCustomerThank you, Ivan. I tried adding that to my JS file. It worked initially when my page first loads. However, when user interaction causes a switch to a flying camera with locked rotation and movement, the scroll becomes locked again. I tried calling my JS function each time the camera changes, but that didn’t seem to work. User can never scroll the window when viewing through a flying camera.
2019-12-10 at 8:28 am #21864Ivan LyubovnikovStaffHowever, when user interaction causes a switch to a flying camera with locked rotation and movement, the scroll becomes locked again.
Oh, yes it’s a bug with the Flying camera. We’ll fix that in the upcoming verge3d release which will happen in 1 or 2 weeks.
As for now, one possible workaround is to disable the controls completely when you switch to a flying camera, for example like this:
if (app.controls) { app.controls.enabled = false; }
– this way it won’t lock the scroll, but the camera will not react to any user input either.
Co-founder and lead developer at Soft8Soft.
2019-12-10 at 2:35 pm #21872Branden CokerCustomerThank you Ivan. I’m actually using my flying camera to tween to locked positions around the scene, so this works perfectly!
2022-02-11 at 6:49 am #49344ma77hewParticipantHi Brandon,
This can be solved only by using javascript API. It’s a simple code snippet, which you can add for example in the standard runCode() function in your application’s js file:
function runCode(app) { if (app.controls) { app.controls.enableZoom = false; } }
– this should completely disable zoom and bring page scrolling back
@ Ivan Lyubovnikov
I have followed your directions this to prevent my parent document from scrolling. However, now my pointerlock controls of W and D to move my camera forward and backward have been disabled as well. Why is this happening?
-
AuthorPosts
- You must be logged in to reply to this topic.