title: Is there a way to display or else retrieve the name of a point in an rgl graph rendered through Shiny?
body: <p>I'm using the RGL package and Shiny to make an app that displays different chosen combinations of principal components from a PCA as a 3D plot. I'm plotting tens of thousands of data points at a time so labeling all the points in the plot is a no-go or else I'm just looking at a hairball. However, it would still be really really useful to be able to get the names of certain points from the plots. Whether this is is through labeling the points in the graph or else displaying the names in a Shiny textOutput doesn't matter too much.</p>
  
  <p>The first approach I tried was using the identify3d() function inside Shiny to try to create a reactive value with the name of the point which I could in the UI as an output, which didn't work and I assume this is because there is no way for identify3d() to communicate with the Shiny app.</p>
  
  <p>The next approach was using the crosstalk package since I have seen there is a vague mention on here of it being useful for doing something similar. I created an rglShared object combining one plot for the points and another plot for the labels (setting them to only be displayed upon selection) and tried to select the points of interest in the plot either through using rglMouse() or through setting the mouseMode to "selecting". I wasn't able to get rglMouse() to work inside Shiny and when I tried to change the mouseMose() using par3d or shinySetPar3d, Shiny didn't like this and would just stop displaying any plot. </p>
  
  <p>Here is the code for some toy example I was trying to get working using the second approach with the mtcars data and rglMouse(). The button for selecting the mouseMode appears alright, but changing it doesn't actually have any effect on the function of the mouse inside the rgl plot.</p>
  
  <pre><code>library(shiny)
  library(crosstalk)
  library(rgl)
  library(manipulateWidget)
  
  data(mtcars)
  
  ui = fluidPage(
    combineWidgetsOutput("rgl_plot"),
  )
  
  server = function(input, output, session){
    output$rgl_plot = renderCombineWidgets({
    rgl.open(useNULL=T)
    ids &lt;- plot3d(mtcars[, 1:3])
    sharedData &lt;- rglShared(ids["data"])
    sharedLabel &lt;- rglShared(text3d(mtcars[, 1:3], text = 1:32,
                                    adj = -0.5),
                             group = sharedData$groupName(),
                             deselectedFade = 0,
                             selectedIgnoreNone = FALSE) 
      rglMouse(rglwidget(shared = list(sharedData, sharedLabel)))
    })
  }
  
  shinyApp(ui = ui, server = server)
  </code></pre>
  
  <p>I'm using Shiny version 1.4.0, rgl version 0.100.30 and crosstalk version 1.0.0 with R 3.6.1.</p>