Replies: 3 comments 7 replies
-
That would be very easy to do in r3f since you already have drag and drop as native pointer events but of course drag controls are also easy to implement. And at the same time this is super complex in plain three. I have demos for both but are on vacation right now. @gsimone do you know any code sandboxes? The canvas creates a default camera, you can always and everywhere access it through useThree and useFrame. But you can also use your own of course. Check out the drei library here on our GitHub, it has simple helpers for that. |
Beta Was this translation helpful? Give feedback.
-
Using your own camera: https://codesandbox.io/s/react-three-fiber-viewcube-py4db Transform controls https://codesandbox.io/s/r3f-drei-transformcontrols-hc8gm Drag (simple) https://codesandbox.io/embed/react-three-fiber-gestures-08d22?codemirror=1 Drag (complex version) https://codesandbox.io/s/r3f-lines-capture-1gkvp |
Beta Was this translation helpful? Give feedback.
-
To lock the controls when transforming, refer to this example https://drei.react-spring.io/?path=/story/controls-transformcontrols--transform-controls-lock-st |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
All reactions