Last active
          December 4, 2019 13:46 
        
      - 
      
- 
        Save tylermorganwall/962dcd192278b53d32f38288f45edf53 to your computer and use it in GitHub Desktop. 
    A simple animation with a scene lit by an HDR environment image (from hrdihaven.com)
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | library(rayrender) | |
| vecx = 10 * sinpi(1:360/180) | |
| vecz = 10 * cospi(1:360/180) | |
| anglevec = -10 * cospi(1:360/90) | |
| for(i in seq(1,360,by=1)) { | |
| generate_ground(material = dielectric()) %>% | |
| add_object(sphere(material = metal())) %>% | |
| add_object(disk(radius=3, inner_radius = 2, angle = c(anglevec[i],-i,0))) %>% | |
| render_scene(parallel = TRUE, environment_light = "shanghai_bund_2k.hdr",fov=40,samples=400, | |
| lookfrom = c(vecx[i],1,vecz[i]), width=800,height=800, filename = glue::glue("ring{i}")) | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment