Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust camera movement #1

Open
mcanepa opened this issue Jan 24, 2018 · 3 comments
Open

Adjust camera movement #1

mcanepa opened this issue Jan 24, 2018 · 3 comments

Comments

@mcanepa
Copy link

mcanepa commented Jan 24, 2018

First of all I must tell you that this is fantastic, congratulations for such a nice work.

I have an issue that I'm not sure if can be corrected via configurarion. This is the scenario:

See this demo and this one, On both examples drag the mouse following this pattern

patetrn

What you should see is that with three.js the object moves slowly following more accurate the mouse, whereas with EasyCam the object moves faster and rotating in other axis.

For example, if I move the mouse only horizontally, in three.js the object moves in that plane, but if I perform the same movement with EasyCam the object kind of start wobbling

@diwi
Copy link
Owner

diwi commented Jan 25, 2018

Hi,

The easycam-behaviour you describe is "camera-roll".
An excentric drag becomes a rotation around the viewers axis == roll.

You can disable it, by limiting the rotations to yaw and pitch only.

easycam.setRotationConstraint(yaw, pitch, roll)

The first example is the default setting, yaw-pitch-roll, all enabled.
easycam.setRotationConstraint(true, true, true);
So, when your drag is very excentric the rotation happens only around the viewer axis (z-axis, when viewed from the top). The more you drag somewhere in the center area of the canvas, yaw and pitch gets effective.
https://jsfiddle.net/wqjugp9m/9/

The second example is more like the three.js example, limited to yaw-pitch.
easycam.setRotationConstraint(true, true, false);
https://jsfiddle.net/wqjugp9m/10/

@joquist
Copy link

joquist commented Apr 6, 2020

I also wanted to say thanks for your work on the library.

I tried implementing the above to fix the issue, calling setRotationConstraint() in setup(), but it doesn't seem to have any effect. I also can't tell whether it works or not in the examples you posted above.

@carlosnavarro-cn
Copy link

Hello Diwi,
I tried successfully your indications to limit the yaw, pitch and roll rotations. I would love to limit the angle for each of this. Right now they have a rotation similar to 360 (or they can rotate infinit times). Is there a way to limit the pitch rotation to 180 degrees, as it happens on this website here: https://app.shapediver.com/m/array-table-dimension

Thanks in advance,
CN

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants