meshcat-dev / meshcat

Remotely-controllable 3D viewer, built on top of three.js
MIT License
256 stars 48 forks source link

Default scene orientation #136

Closed kielnino closed 9 months ago

kielnino commented 1 year ago

Hi, thank you for this amazing and easy to use viewer.

In my projekt I would like to have a more classical orientation of the scene with the z-axis not pointing up and down but away from the camera.

Can we make the default orientation set here maybe customizable?

If this is an option, I can maybe propose a PR by myself.

RussTedrake commented 1 year ago

You can accomplish this already; just set the camera property immediately. For instance, we do it here: https://github.com/RobotLocomotion/drake/blob/5a93364f958dbf137d1461fe5e07c9f97de0eb49/geometry/meshcat.html#L101

kielnino commented 1 year ago

Hi @RussTedrake, thanks for the hint. I'm not sure if I got your point completly, but setting the camera to a different position does only change the viewing direction. The problem is, that the orbit-control is also locked in the wrong axis. But maybe I need to study the chapter on camera-control a little bit.

Vinggui commented 1 year ago

@kielnino Check how this PR works with the camera, does it help you?