Comments (8)
That's the only value associated with the inertia effect. If it stops almost immediately on mobile, I'm guessing the touch input code is causing the speed drop right before / as one's finger is lifted.
from pannellum.
Could you find out something more using the iPhone?
from pannellum.
I was right. The speed was often zeroed right before one's finger was lifted. In JavaScript, the mouse / touch position can't be polled at a set interval; one has to use the mousemove / touchmove events, which don't fire when the mouse / touch is stationary. This causes problems when a user rapidly moves the mouse, quickly stops, and then releases the mouse button, as the last move event that fired showed a large movement, even though the pointer has actually stopped. If not handled, this causes inertia to be applied, and the panorama jumps when the mouse button is released. To remedy this, I zero the pitch and yaw speeds when the button is released if the last move event was too long ago. This works well on the Desktop, but the zeroing delay was too aggressive on mobile, so I lengthened it. Doing so fixes this issue, but if I try to, I can cause the jumps this zeroing was meant to prevent. However, on touch screens, people usually flick instead of move-stop-release, so this shouldn't be an issue in practice.
from pannellum.
Now the jumps on the Desktop version are happening much often.
If this jump is caused by that last if (Date.now() - latestInteraction > 15)
probably this value (15 or 150) have to be different depending on the device (ugly user agent check).
from pannellum.
On the Desktop, nothing should have changed. I only changed the touch value, not the mouse value.
from pannellum.
Related with the Drag & Drop experience: testing with Android and iPhone it looks like when you drag a point and move it through the screen, your finger moves faster than the point you dragged.
In pannellum.js, inside the method onDocumentTouchMove
there are those two constants 0.1
and 0.2
used for those events. If i change the 0.1 constant there for 0.25 it already feel much more responsive and smoother on Mobile devices, and almost the same on Desktop.
I guess those multiplier values are there to select the degree of relevance of each part of the equation, but I don't make a pull request cause you know better which values are working better. However, you should try with those 0.25 (or even more) and see If the result is as you like.
from pannellum.
And about the "jumping", we experience it now more often than before. I'm not sure if is due to those latest changes or something else.
from pannellum.
I didn't actually write the touch code; it's from a pull request. I've also noticed the issue with the difference in movement between one's finger and the panorama, but haven't tried to fix it yet. On the desktop, things aren't perfect, but they're much better.
I need to look at how Leaflet does things, since it doesn't have an issue with jumping.
from pannellum.
Related Issues (20)
- Pannelum load event with multires HOT 3
- "type": "cubemap" pattern, Whether to support network pictures? HOT 5
- Avoid MC Escher effect HOT 2
- I've installed pip3 install numpy, but when I run pip3 install --user pyshtools, ModuleNotFoundError: No module named 'numpy' [end of output] HOT 8
- Multiple hotSpot types HOT 1
- clearing the cache of the program HOT 2
- ADD HOTSPOT HOT 1
- Add option to show clamped offscreen hotspots
- Custom Hotspot HOT 3
- animatefinished event HOT 4
- An easy way to position hotspots HOT 1
- how to use generate.py script in PHP project? HOT 3
- Setting the viewing angle of the image when displayed HOT 1
- replace `equirectangular` to `multiRes` in tours HOT 6
- How to view full panorama like the attachment HOT 2
- Image anti-aliasing? HOT 2
- Problem with old LG LG-R105 images on Pannellum HOT 1
- Black squares on multires panorama on low screen size HOT 3
- Javascript Image Swap works in 2.2 but not > 2.2 HOT 3
- pannellum with video js shows in poor quality HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pannellum.