meshcat-dev / meshcat

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

Fix orthographic camera #75

Closed RussTedrake closed 4 years ago

RussTedrake commented 4 years ago

And demonstrate that it can be constructed via the handle_command interface. This example implements essentially a "planar visualizer" (in the language of drake).

Resolves #3


This change is Reviewable

RussTedrake commented 4 years ago

test/orthographic_camera.html, line 64 at r1 (raw file):

                path: "/Cameras/default/rotated",
                object: {
                    object: {

btw -- i don't actually really understand why I needed the nested objects here. is that what you would have expected?

rdeits commented 4 years ago

btw -- i don't actually really understand why I needed the nested objects here. is that what you would have expected?

Yeah, it's correct. This is just a slight weirdness of the threejs API, combined with the fact that I use "object" to mean "thing you want to create" and threejs also uses it as a field of the object itself. You can see the same nested object in the set_object API documentation in the Readme.

rdeits commented 4 years ago

Looks great, thanks!