R/readGLtf.R

Defines functions readglTF

Documented in readglTF

readglTF <- function(path, defaultbin = NULL, ...) {
  gltf <- read_json(path, ...)
  if (is.null(gltf[["scene"]]) && length(gltf$scenes))
    gltf$scene <- 0
  if (is.null(gltf$asset) || as.numeric_version(gltf$asset$version) != "2.0")
    stop("This function can only read GLtf version 2.0 files")
  Gltf$new(gltf, defaultbin = defaultbin)
}
dmurdoch/rgl2gltf documentation built on Nov. 19, 2024, 9:41 p.m.