Skip to content
Prev 25609 / 29559 Next

WebGL Earth

HI Richard,
On Tue, 18 Apr 2017 at 11:50 Richard Barnes <rbarnes at umn.edu> wrote:

            
I put this together to put various R data structures into forms ready for
rgl or WebGL:

https://github.com/r-gris/rangl

The pattern is

## convert to table entities
x <- rangl(object)

## plot in rgl form and return the rgl structure (list of arrays)
rg <- plot(x)

## optionally convert to geocentric coordinates rather than the native CRS
rg <- plot(globe(x))

 The geocentric step is merely transformation on the unique vertices after
decomposition to primitiveslike, so it can be done independent of any other
structure.

This is how I would transfer data to WebGL, with optimizations as needed. I
wish we had a general central core with primitives like this but ultimately
it's just tables and indexing so pretty easy to do.

Cheers, Mike.


Just wanted to inquire as to whether anyone's already built such a thing