Introducing #R2VR

rstats R2VR WebVR GIS
Miles McBain

This post marks the start of series in which I will describe methods I have developed to make GIS data explorable in Virtual Reality. The overarching strategy is to use R’s spatial ecosystem to generate the 3D data, and then render it in online VR environments created with A-Frame WebVR. To make sense of the posts you’ll need an intermediate understanding of R, and basic familiarity with HTML for the A-Frame bits.

The ideas expressed here are currently being wrapped up into a yet to be named R package. These posts are as much about getting the details straight in my own head, as they are to provide some documentation to my new collaborators.

The posts will break down along these lines:

  1. Making Meshes from Polygons and Rasters
  2. Rendering Meshes in WebVR
  3. Shading Meshes using GIS layers
  4. Annotating Meshes with WebVR elements
  5. Serving Multi-User WebVR Scenes

Please consider these as all as RFCs. I am new to spatial, 3D graphics, and web programming. I would love feedback from my betters in these fields. In that regard I would like to thank Michael Sumner (Master Spatial Artificer) for his ideas and enthusiasm so far.

Finally, an illustrative example. Given some raster data like this:

A vegetation index raster

Figure 1: A vegetation index raster

We can arrive at this:

Elevation, vegetation, and water in WebVR

Figure 2: Elevation, vegetation, and water in WebVR

And that’s just for starters! We should be able to have some fun with this. Thanks for following along.

Work described here is part of a project funded by ACEMS in partnership with CSIRO Data 61, at Queensland University of Technology. Specialist support has been provided in-kind by the Australian Antarctic Division.


If you see mistakes or want to suggest changes, please create an issue on the source repository.


Text and figures are licensed under Creative Commons Attribution CC BY 4.0. Source code is available at, unless otherwise noted. The figures that have been reused from other sources don't fall under this license and can be recognized by a note in their caption: "Figure from ...".


For attribution, please cite this work as

McBain (2018, March 27). Before I Sleep: Introducing #R2VR. Retrieved from

BibTeX citation

  author = {McBain, Miles},
  title = {Before I Sleep: Introducing #R2VR},
  url = {},
  year = {2018}