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

Camera Rotation Limit #1233

Open
saalem-git opened this issue Sep 28, 2022 · 4 comments
Open

Camera Rotation Limit #1233

saalem-git opened this issue Sep 28, 2022 · 4 comments

Comments

@saalem-git
Copy link

saalem-git commented Sep 28, 2022

Hi,
It's been a few days since I am exploring x3dom which looks really cool library for the 3D.
I wonder how can we limit the camera rotation to only left and right (when we rotate left and right)?
The issue in this link https://360vt.my/x3dom/

Possible to get the camera like this example? https://sketchfab.com/3d-models/one-thousand-museum-8c75e29b301d46498d19e6cee780832f

I read the documentation and there is Navigation that is used for the camera control. We can use attributes type = (Examine, Walk, Fly, Helicopter, Look at, and Turntable) but none of them work out.

@microaaron
Copy link
Contributor

Try game mode please.
https://doc.x3dom.org/tutorials/animationInteraction/navigation/index.html
https://doc.x3dom.org/tutorials/animationInteraction/navigation/example.html

@saalem-git
Copy link
Author

@microaaron,
Thanks for the reply. I tried the game mode also but it does not work. Firstly, the camera movement is the same as before, and in game mode, the model moves when the cursor moves too.

@microaaron
Copy link
Contributor

Maybe you need to capture keyboard and mouse events and calculate the position and orientation of the Viewpoint by yourself.
https://doc.x3dom.org/tutorials/animationInteraction/viewpoint/index.html

@andreasplesch
Copy link
Contributor

If you are willing to use a newer version than 1.5.0, you could try turntable mode (press "n"). This mode would be closest to the sketchfab camera. https://doc.x3dom.org/tutorials/basics/hello/HelloX3DOM.html, press "n".

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

3 participants