Friday, September 3, 2010

Tachyon in Sage: depth of field perspective



Today I found a bug in the options to the tachyon raytracer in Sage. It should be possible to use alternate projections, including fisheye lens and perspective depth-of-field projections. I think I've fixed that, patch should get into sage-4.6 or so.

Here's a quick example:

T = Tachyon(xres=800,antialiasing=24, raydepth=12, projection = 'perspective_dof', focallength = '1.0', aperture = '.005')
T.light((0,5,7),1.0,(1,1,1))
T.texture('t1', opacity=1, specular = .3)
T.texture('t2', opacity=1, specular = .3, color = (0,0,1))
T.texture('t3', opacity = 1, specular = 1, color = (1,.8,1), diffuse=0.2)
T.plane((0,0,-1),(0,0,1),'t3')
ttlist = ['t1','t2']
tt = 't1'
T.cylinder((0,0,.1),(1,1/3,0),.05,'t3')
for q in srange(-3,100,.15):
if tt == 't1':
tt = 't2'
else:
tt = 't1'
T.sphere((q,q/3+.3*sin(3*q),.1+.3*cos(3*q)), .1, tt)
T.show()

No comments: