processing-r / Processing.R

R Language Mode in Processing for Creative Coding, created by @gaocegege, maintained by @jeremydouglass
https://processing-r.github.io/
GNU General Public License v3.0
143 stars 16 forks source link

Support PVector #241

Closed gaocegege closed 6 years ago

gaocegege commented 6 years ago

Now we could do the trick:

settings <- function() {
    import(processing.core.PVector)
    # Please install the peasycam before you run the example.
    importLibrary("ComputationalGeometry")
    size(800, 800, P3D)
}

setup <- function() {
}

draw <- function() {
      iso = IsoSurface$new(processing, PVector$new(0,0,0), PVector$new(100,100,100), as.integer(8));
    for (i in 0:9) {
    pt = PVector$new( random(100), random(100), random(100) );
    iso$addPoint(pt);
}
    iso$plot(mouseX/10000.0)
}