regl-project / regl-camera Goto Github PK
View Code? Open in Web Editor NEWA camera for regl
Home Page: https://regl-project.github.io/regl-camera/
License: MIT License
A camera for regl
Home Page: https://regl-project.github.io/regl-camera/
License: MIT License
The most recent version on npm is missing at least one PR. Is it possible to publish the latest to npm? Thanks!
Touch events on mobile aren't being captured by the underlying mouse-change
package used by regl-camera
.
Could potentially be solved by replacing use of mouse-change
with https://interactjs.io/docs which abstracts click/touch and also supports gestures which would enable adding pinch to zoom on mobile
I like my mouse generally fast. That means that 90% of my interactions with a regl camera get intercepted by inertia, which makes it rather difficult to control. Would a PR to disable the inertia feature or at least set a higher threshold be desirable?
(Sorry, wrong repo)
As the title says I can't figure out how I'm supposed to update the camera externally from my consuming code. From the README it seems like you're supposed to just mutate properties of the camera
function or on the arguments returned in the callback block, but in all my attempts the properties are all mostly undefined
and updating them doesn't have any effect.
Looking at the source it seems like this is due to the fact all of these externally exposed properties are being copied by value rather than reference.
I have found a work-around for this by exposing the updateCamera
method for external code to call which is available in my fork, but I wanted to know if there's a "correct" way to do this without modifying the library, or is this module intended to be purely internal state?
Nice library, great work! However, I seem to have hit a snag in my usage.
I am setting up a view where Z-axis points up, and X/Y describe a horizontal plane that the viewer is looking at from above. I specified the up
vector to be [0, 0, 1]
, correspondingly, but that's when mouse rotation stopped working: both horizontal and vertical mouse movement only change the "theta" angle. Seems like that is because the Z-axis is hardcoded to also be the "front"? Where I need it to be [0, 1, 0]
instead.
In other words, since the options accept an up
vector, it would be nice to set the front
as well.
Thanks!
If you rotate the view to the top, you immediately get gimbal lock and NaNs and the view goes blank. Perhaps a better behavior would be to clip phi
to pi / 2 - epsilon
so at least the view doesn't disappear.
node_modules/regl-camera/regl-camera.js:32
element.addEventListener('mousewheel', function (e) {
^
TypeError: Cannot read property 'addEventListener' of undefined
This is a great simple camera but pan functionality would be very useful.
doc says values likes theta
, phi
, distance
are injected into context, but they are stale
https://github.com/regl-project/regl-camera/tree/0182e4ef8511f987925ada18c1eb63d349e7fd6c#camerablock
this is because cameraState
values are copied once on camera create
Line 140 in 0182e4e
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.