firtoz / react-three-renderer

Render into a three.js canvas using React.
https://toxicfork.github.com/react-three-renderer-example/
MIT License
1.49k stars 155 forks source link

Camera doesn't support camera.up #206

Open nick-parker opened 6 years ago

nick-parker commented 6 years ago

In vanilla Three.js it's reasonably common for users to do: camera.up.set(0,0,1)

This makes Z up in the viewport, which matches the standard for a lot of design programs e.g. for 3d printing. For whatever reason I can't access this feature in R3R. I tried setting it via a ref to the camera and it does set, but has no effect.

I also forked this repo and took a shot in the dark at adding the up prop to the PerspectiveCameraDescriptor, but that didn't work and I haven't dived deeper yet.

https://github.com/nick-parker/react-three-renderer/blob/compiled/src/lib/descriptors/Object/Camera/PerspectiveCameraDescriptor.js#L12

Any tips on this? I just want Z up, doesn't matter too much how I achieve it. My next plan is to fiddle with the projection matrix directly.