Skip to content

Instantly share code, notes, and snippets.

@marcosci
Created January 2, 2022 07:43
Show Gist options
  • Save marcosci/6bfdd8c08ff340b059d3f6cea35b4ed9 to your computer and use it in GitHub Desktop.
Save marcosci/6bfdd8c08ff340b059d3f6cea35b4ed9 to your computer and use it in GitHub Desktop.
options(
repos = c(tylermorganwall = 'https://tylermorganwall.r-universe.dev',
CRAN = 'https://cloud.r-project.org')
)
install.packages('rayrender')
library(rayrender)
for (i in seq(720, 1, by = -1)) {
generate_studio(depth = -1, material = diffuse(color = "white")) %>%
add_object(sphere(
radius = 0.99,
material = diffuse(image_texture = "textures/8k_mars.jpeg"),
angle = c(0, -i / 2, 0)
)) %>%
render_scene(
samples = 16,
width = 1200,
height = 1200,
aperture = 0,
fov = 30,
ortho_dimensions = c(2.3, 2.3),
sample_method = "sobol_blue",
filename = sprintf("renderings/mars%d.png", i)
)
}
system("ffmpeg -framerate 90 -i renderings/mars%d.png -pix_fmt yuv420p renderings/mars4.mp4")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment