Skip to content

Instantly share code, notes, and snippets.

@tylermorganwall
Last active February 4, 2023 18:41
Show Gist options
  • Save tylermorganwall/6eec188192f4c24cf8ee05ffec23ec81 to your computer and use it in GitHub Desktop.
Save tylermorganwall/6eec188192f4c24cf8ee05ffec23ec81 to your computer and use it in GitHub Desktop.
Heliocentric Cube (genart)
library(rayrender)
library(RColorBrewer)
colors = brewer.pal(n = 8, name = "Dark2")
set.seed(1)
spherelist = list()
for(i in 1:1000) {
spherelist[[i]] = sphere(x=runif(1)*535+10,y=runif(1)*535+10,z=runif(1)*535+10,
radius=10,
material=glossy(color = sample(colors,1)))
}
spherelistss = do.call(rbind,spherelist)
for(i in 1:360) {
generate_cornell(light=FALSE) %>%
add_object(animate_objects(spherelistss, start_pivot_point = c(555,555,555)/2,
end_pivot_point = c(555,555,555)/2,
start_time = 0,
end_time = 1,
start_angle = c(3*i,i,2*i), end_angle = c(3*(i+1),(i+1),2*(i+1)))) %>%
add_object(sphere(x=555/2,y=555/2,z=555/2,radius=10,material=light(intensity=500))) %>%
render_scene(samples=128,clamp_value = 10,width=800,height = 800,
sample_method = "sobol_blue",
filename=sprintf("pivotpoint%d.png",i),
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment