ThatOpen / engine_components

MIT License
350 stars 134 forks source link

WASD navigation in FPS camera mode in components #12

Closed keshavanarayan closed 1 year ago

keshavanarayan commented 1 year ago

Hi @harrycollin @agviegas @MadsHolten @HoyosJuan,

How do I create wasd navigation in fps mode in openbim-components? The code seems to toggle fps mode but does not provide wasd navigation. Any suggestion will be of great help.

image

keshavanarayan commented 1 year ago

Here's my code for reference. https://github.com/keshavanarayan/viewer/blob/b87e9c9468a854347e88cb4743e0e467b10812ab/src/main.js#L28

agviegas commented 1 year ago

Hey @keshavanarayan you can use camera.controls to access the camera controls instance, which will give you all the functions you need to control the camera around. Again, no need to tag folks in the issue 🙂 Let us know how it goes. Cheers!

keshavanarayan commented 1 year ago

Thank you @agviegas. This snippet works. Thank you for the help.

image