Skip to content

Instantly share code, notes, and snippets.

@kogcyc
Created January 7, 2019 20:06
Show Gist options
  • Save kogcyc/0be8c9a74708dc5dcd73e6f505c48ab6 to your computer and use it in GitHub Desktop.
Save kogcyc/0be8c9a74708dc5dcd73e6f505c48ab6 to your computer and use it in GitHub Desktop.
example of using vapory to run Povray
# vapory depends on numpy
from vapory import *
camera = Camera( 'location', [30,30,-30], 'look_at', [0,0,0] )
light1 = LightSource( [100,100,-200], 'color', [1,1,1] )
light2 = LightSource( [-100,-100,200], 'color', [1,1,1] )
bg = Background('color',[1,1,1])
ll = []
for a in range(-40,41):
for b in range(-40,41):
aa = a / 10.0
bb = b / 10.0
c = [aa*3,(aa*aa)-(bb*bb),bb*3]
sphere = Sphere( c, 1, Pigment( 'color', [1.2,1.2,1.2] , 'scale', [1,1,1]))
ll.append(sphere)
scene = Scene( camera, objects= [light1, light2, bg, *ll])
scene.render("saddle.png", width=800, height=600)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment