0

I have a 3D rgl plot that users can modify based on some inputs (you can see it in action at https://magalab.shinyapps.io/rgl_test/). But every time the user modifies the input settings, renderer returns to the initial orientation to redraw the model. I want to keep the orientation consistent between updates. I know how to do that in rgl, and there is already another similar question (Shiny RGL Plot3D: Keep Plot View Orientation On Replot), which did not receive any answer.

There is potentially a relevant topic at shiny app rglwidget get userMatrix to generate another plot with same rotation, but I don't want to see the userMatrix, simply pass it to the open3d().

Unfortunately, I am not familiar with Javascript and Shiny to achieve this. Any pointers will be much appreciated.

MLavoie
  • 9,671
  • 41
  • 36
  • 56
  • I think the approach in Mike Wise's answer to https://stackoverflow.com/questions/36837472/shiny-app-rglwidget-get-usermatrix-to-generate-another-plot-with-same-rotation should work. You don't need to display the matrix, that was just to show that it was successfully retrieved. But you are going to need to learn more about Shiny to modify his answer to do what you want. – user2554330 Aug 18 '18 at 11:32

1 Answers1

0

In the very newest rgl (version 0.99.18, currently only on R-forge), there's a function called shinyGetPar3d that is designed to do what you want. See example(shinyGetPar3d) for a demonstration of how to use it.

user2554330
  • 37,248
  • 4
  • 43
  • 90