Rather than writing ideas here, they should appear as Github
issues.  I've started some of them.

To-do:

Need to rationalize the inclusion of figures in R Markdown 
documents.  There are 5 possibilities:  as WebGL, as a link
to a snapshot file, as a base64 image, or as WebGL plus one of 
the image formats.  Currently the
README.Rmd isn't showing the snapshot because it's ignoring the
fig.path and trying to use a base64 image, which is not supported
by Github markdown. DONE

Work on ways to modify a scene in Shiny and only transmit the
changes to the browser.

Incorporate changes for updated knitr; need to work with both
old and new for a while. DONE

Transparent 3D sprite drawing should be updated to be 
consistent with transparent spheres.

Add segments and points to mesh objects?  Maybe make mesh objects
completely general, and pass them as objects in rglwidget()?
If so, the design should be revised to be more like a collection
of dataframes with attributes. DONE

Drop re-use of parts of other scenes?  This would simplify the
code a lot, and probably wouldn't cost much for typical uses. DONE

Create *3d functions corresponding to all remaining rgl.* functions.

Maybe put all newly created obj fields from initObj into one
place in object, so the original object is left unmodified?

In the same vein, rglwidget() should contain a copy of the
original scene, so it could be used to reconstruct it, e.g.
for plotting in .PNG.  Partly done.  Maybe rglwidget() should
should contain almost nothing else, only calling convertScene
when printed?

Look into updating FTGL.  (We're up to date with the
official release, which hasn't been updated for a long
time.  There are unofficial bug fixes on Github.)  Allow
rotated text?  This needs to use texture based fonts
instead of the current bitmap based fonts.

Work on axes:  try to avoid hiding labels behind the plot, etc.

Support fog in rglwidget().  

It would be nice to have an "onresize" event, so bgplot3d
could redraw itself.  But this isn't going to work in WebGL,
since it has no way to call R to redraw (other than in Shiny).  Maybe have multiple copies of images, produced at 
different sizes, i.e. manually generated mipmaps?

Allow grid3d to draw on an arbitrary plane (e.g. to show lm() results).

Look into updates to more modern OpenGL, e.g. https://developer.apple.com/opengl/Migrating_to_OpenGL_Core_Profile.mov

Investigate difference between clear3d() and rgl.close()
when subscenes are in use -- see March 3, 2018 presentation.

add panning mouse mode.

Investigate off-screen rendering: renderbuffer or framebuffer objects,
Xvfb, etc.

Port sphere facet sorting to WebGL.

Draw other nested objects (3d sprites, ...) like spheres are now drawn.  Make sure the new "primitive" functions (getPrimitiveCount, 
getPrimitiveCenter) work for other types besides spheres.

Use webshot2 to save images; current version can work headless,
but is not on CRAN, so must be installed from Github.
DONE

Add a class to the result of open3d(), so that it acts
like a highlevel() call for auto printing in knitr. DONE

Transparent sphere sorting wasn't implemented properly in WebGL. FIXED

Add function to merge mesh objects. DONE

should reset=TRUE be default in setupKnitr? DONE, removed argument.

Write function to split up intersecting or inconsistently overlapping transparent polygons. -- This is hard! WON'T DO

Add filledContour3d function.  Fix inconsistencies:  function
args, draw or not, arg names in filledContour3d,
contourLines3d, clipMesh3d, clipObj3d. DONE

Add contour lines to various persp plots.  How will it work if 
more than one of x, y, z are matrices? DONE more generally 
via contourLines3d.

Material property depth_mask is ignored in rglwidget(). FIXED

setupKnitr(autoprint=TRUE) doesn't seem to work in .Rnw file.
FIXED

Allow plot3d.lm to limit the surface to the convex hull (or a
slightly larger region?) of the predictors, or a high density
region in the predictors. DONE

Put class on open3d() result so it acts like a high level plot. PROBABLY WON'T DO -- this doesn't work well.

Option to include static rgl plots even in HTML output? DONE

Do something like meshColor in shade3d for texture
coordinates. DONE

Add knit_print method to rglWebGL class so rglwidget can
print as snapshot when printing from a PDF project. DONE

rglwidget() doesn't respect front and back material properties 
for spheres. FIXED

sphere sorting is too slow; sort by centres only?  Or only do
full sort for small counts?  DONE

wire3d etc. should allow "front" and "back" material
properties to be overridden.  Basically the three of
them should be the same function with different defaults.
DONE

After example(legend3d), things are mixed up: the
viewport doesn't match the place where things are drawn. FIXED 
legend3d or bgplot3d should look at r3dDefaults to set the
background colour. DONE

getr3dDefaults() should be able to return values for things
that aren't mentioned in r3dDefaults, going back to the original source. DONE

Fix "reuse" bug in rglwidget():  reused data isn't being found. FIXED!

Allow rgl.attrib() to return normals even if lit is FALSE.  (See
https://r-forge.r-project.org/tracker/?func=detail&atid=949&aid=6661&group_id=234).  rglwidget() will need modification to
suppress them if they are not needed. DONE

plot3d(scene3d()) doesn't set up par3d("listeners") properly. FIXED

Move tkrgl functions into rgl.  DONE

Bug:  when combined with other widgets, the rglwidget should get
an elementId even in Shiny. FIXED

Fix problem with example(legend3d):  plot is too small.  DONE?

Resizing a cell in mfrow3d() applies the change to the
wrong cell.  See https://r-forge.r-project.org/forum/forum.php?thread_id=33806&forum_id=757&group_id=234.
This only happens in R, not in the rglwidget display.  FIXED

Resizing happens asynchronously, causing bugs (https://stackoverflow.com/q/58546011/2554330).  FIXED

Make as.mesh3d.ashape3d compatible with nat::as.mesh3d.ashape3d  DONE

Support meshColor argument in creating a mesh, not just shading it.  DONE

Handle replication of colors better in subdivision3d. DONE

If you pop a 3d sprite object, R crashes.  FIXED

Mouse wheel operation causes crash:  example(plot3d) followed by 2 finger drag on Mac. FIXED

Setting par3d(mouseMode = c("none", "none", "none")) doesn't
seem to do anything:  still have trackball in persp3Drgl example.  There was a bug (leaving trackball in place), but
also mouseMode applied by design to the whole device, where it should really be subscene specific. FIXED

rgl.select() doesn't appear to work properly when the 
current subscene doesn't fill the screen, e.g.
mfrow3d(1,2); plot3d(x,y,z); rgl.select("left")
FIXED

Allow "zooming in" on a particular point.  Do this by allowing modelMatrix and projMatrix to be set by the user.
DONE by adding userProjection.

Add support for ashape3d objects from alphashape3d package.
DONE

Think about formula interface for plot3d and persp3d. DONE

Bug in text display?  Bits of text disappear as example(arc3d)
is rotated. FIXED in example:  it's an interaction of 
transparent polygons.

Add support for interp::tri.mesh and tripack::tri.mesh (like deldir).  DONE.

Fix up color argument for meshes.  How about this:  material colors
always apply to vertices.  Separate arguments for edges, triangles and quads.
Will need a legacy argument for old behaviour. DONE

Make X11 optional at configure time.  This is a big job:  all OpenGL calls
depend on X11 on Unix-alikes.

Update GL2PS to 1.4.0. DONE

Add polygonOffset to material properties. DONE

Extend arc3d so that it can do the longer arc, or multiple
turns around the center? DONE

Bug reported on Stackoverflow:  drawing a transparent object after plot3d with
limits puts it in a different subscene, so it may be drawn early and mess up
transparency. PARTLY FIXED:  transparent is always drawn after solid, but 
maybe not in the right order.

example(plotmath3d) doesn't display in rglwidget. FIXED

Another bug:  planes apparently draw to the Z buffer when transparent.  
NOT FIXED:  transparent things should be drawn in back to front order, so this
is okay.

Add pos argument from text() to text3d; 
incorporate plotrix::thigmophobe logic for auto-positioning. DONE

Support par3d() queries and sets in Shiny. DONE

planes3d() should just store the a,b,c,d parameters, and allow
them to be manipulated directly in Javascript.  It already did,
but vertexSetter didn't know how to manipulate them.  Now it
does.  DONE

Draw spheres one facet at a time when they are transparent so 
overlapping spheres will be rendered properly.  This needs two
meanings for "getElementCount" and "drawElement":  for spheres,
each facet needs to be returned separately. DONE

Add polar mouse control to WebGL. DONE

Fix Javascript so that if we're in ioslides, only 
consider us to be in the viewport if the enclosing slide has class "current".
DONE

Handle loss of context based on two flags:  has context, is visible.  Initialize with context if visible, 
no context if not.  If we have no context, respond to
scrolling/slide change events and get context if we become visible.  If we have a context, can ignore those events,
but need to watch for context lost messages.
When we get a context lost message, set to "no context".
When we get a context restored message, treat as initial.  DONE

Fix bug in setSubsceneEntries (not calling delFrom etc.)

Check through rglExamples and fix errors.
 - bg3d
 
Check that the Javascript changes the JSON values as 
well as the buffer matrix.

Handle all attributes like user attributes in WebGL.

Use shaders in R.  Windows might not support this...

Simplify controls, widgets, etc., and document only the recommended way.  Link from ?play3d, reproducing the example
there.  

Handle background image as in example(bg3d).  Partly done.

Need a toggleButton equivalent. DONE

Make glVersion visible to users. DONE

Use magick package in movie3d. DONE

Generate .Rmd file for examples automatically. DONE.

Add wireframe and dot handling of polygons using extra coordinates:  for triangles, measure distance
from opposite edge in pixels, set extra coordinate for that vertex to (dist, 0, 0).  (Others will be
(0, dist, 0) and (0, 0, dist)).  Then fragments for which all coordinates are greater than linewidth
are discarded.  (For points, need two coords to have small coordinates.) May need to expand the triangle a
bit to allow fat lines outside the range. NOT DONE, BUT
A BETTER APPROACH WORKED.

Try "magick" before "convert" in movie3d. DONE

Allow user-specified shader (for testing the above!)
in WebGL. DONE

Finish fixedSize in rglwidget. DONE

Handle lost context.  See:
https://www.khronos.org/webgl/wiki/HandlingContextLost.  DONE.

Possibly generate rglwidget() call just before clear
or open operations.  WON'T DO:  it appears in the wrong place in RMarkdown documents.

Need to finish and document rgl.printRglwidget settings.  DONE

Add texture handling to spheres per messages
from Justin McManus (Aug, 2016). DONE

Fix bug in agecontrol: if object has 2 colours but more points, it gets messed up. DONE

Work around 65K vertex limit.  Maybe all we need is the OES_element_index_uint 
extension?  DONE

Improve readOBJ to handle more files. DONE

Fix alias in text and 2D sprites. DONE

Fix interaction of fat lines with ageControl. DONE

Allow single-color objects to be modified by ageControl.  DONE

Maybe make all WebGL objects into indexed objects, to simplify the
code a bit. DONE

Fix circles in transparent linestrips (e.g. example(ageControl)).  DONE, though there are still a few artifacts.

axes3d() with "bbox" doesn't send parameters to bbox3d. FIXED


Investigate crosstalk integration:  see http://rstudio.github.io/crosstalk/authoring.html.   DONE

add selection mouse mode. DONE

Bug in lines3d??? example(vertexControl) shows dashed
line in rglwidget(), probably because lines3d is acting
like segments3d. FIXED

Work out behaviour if scene is rotated while brush
is visible.  Should it change the selection, or 
remove the brush?  Yes, FIXED.

Fix auto-sizing of widget when it is in a tagList. DONE using
combineWidgets instead.

Initialize scene based on starting slider value.    DONE
