#9855: fix support for projection options in Tachyon
------------------------+---------------------------------------------------
   Reporter:  mhampton  |       Owner:  jason, was         
       Type:  defect    |      Status:  needs_review       
   Priority:  minor     |   Milestone:                     
  Component:  graphics  |    Keywords:  tachyon, raytracing
     Author:            |    Upstream:  N/A                
   Reviewer:            |      Merged:                     
Work_issues:            |  
------------------------+---------------------------------------------------

Comment(by mhampton):

 Here's a somewhat recursive example that shows the use of the fisheye
 projection and then uses that image as a plane tiling.  This needs to be
 done in the notebook, or you need to change the DATA directory to
 something else.


 {{{
 T = Tachyon(xres = 800, yres = 600, camera_center = (-2.0,-.1,.3),
 projection='fisheye', frustum=(-1.0, 1.0, -1.0, 1.0))
 T.texture('t1',color=(0,0,1))
 cedges = [[[1, 1, 1], [-1, 1, 1]], [[1, 1, 1], [1, -1, 1]], [[1, 1, 1],
 [1, 1, -1]], [[-1, 1, 1], [-1, -1, 1]], [[-1, 1, 1],  [-1, 1, -1]], [[1,
 -1, 1], [-1, -1, 1]], [[1, -1, 1], [1, -1, -1]], [[-1, -1, 1], [-1, -1,
 -1]], [[1, 1, -1], [-1, 1, -1]], [[1, 1, -1],  [1, -1, -1]], [[-1, 1, -1],
 [-1, -1, -1]], [[1, -1, -1], [-1, -1, -1]]]
 for ed in cedges:
     T.fcylinder(ed[0],ed[1],.05,'t1')
 T.light((-4,-4,4),.1,(1,1,1))
 T.show()
 }}}

 {{{
 T.save(DATA+'t1.png')
 r2 = os.system('convert '+DATA+'t1.png '+DATA+'t1.ppm')
 T = Tachyon(xres = 800, yres = 600, camera_center = (-2.0,-.1,.3),
 projection='fisheye', frustum=(-1.0, 1.0, -1.0, 1.0))
 T.texture('t1',color=(0,0,1))
 T.texture('p1',color=(1,1,1),opacity = .1, imagefile=DATA+'t1.ppm',
 texfunc=9)
 cedges = [[[1, 1, 1], [-1, 1, 1]], [[1, 1, 1], [1, -1, 1]], [[1, 1, 1],
 [1, 1, -1]], [[-1, 1, 1], [-1, -1, 1]], [[-1, 1, 1],  [-1, 1, -1]], [[1,
 -1, 1], [-1, -1, 1]], [[1, -1, 1], [1, -1, -1]], [[-1, -1, 1], [-1, -1,
 -1]], [[1, 1, -1], [-1, 1, -1]], [[1, 1, -1],  [1, -1, -1]], [[-1, 1, -1],
 [-1, -1, -1]], [[1, -1, -1], [-1, -1, -1]]]
 T.plane((0,0,-1),(0,0,1),'p1')
 for ed in cedges:
     T.fcylinder(ed[0],ed[1],.05,'t1')
 T.light((-4,-4,4),.1,(1,1,1))
 T.show()
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9855#comment:3>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to