Transposed y and z in povray
authorDmitriy Morozov <dmitriy@mrzv.org>
Tue, 21 Jun 2011 16:24:27 -0700
changeset 17 9f4bf1795d51
parent 16 69f6b439b161
child 18 7d5e8fdf69f2
Transposed y and z in povray
povray.py
--- a/povray.py	Tue Jun 21 16:21:45 2011 -0700
+++ b/povray.py	Tue Jun 21 16:24:27 2011 -0700
@@ -6,12 +6,13 @@
     <%(vx)f, %(vy)f, %(vz)f>,
     %(r)f
     texture { pigment { color rgb <%(cr)f, %(cg)f, %(cb)f> } }
-}\n''' % {  'ux': u.x,
-          'uy': u.y,
-          'uz': u.z,
+}\n''' % \
+       {  'ux': u.x,
+          'uy': u.z,
+          'uz': u.y,
           'vx': v.x,
-          'vy': v.y,
-          'vz': v.z,
+          'vy': v.z,
+          'vz': v.y,
           'r': r,
           'cr': c[0],
           'cg': c[1],
@@ -23,9 +24,10 @@
 {
     <%(x)f, %(y)f, %(z)f>, %(r)f
     texture { pigment { color rgb <%(cr)f, %(cg)f, %(cb)f> } }
-}\n''' %  { 'x': c.x,
-          'y': c.y,
-          'z': c.z,
+}\n''' % \
+        { 'x': c.x,
+          'y': c.z,
+          'z': c.y,
           'r': r,
           'cr': color[0],
           'cg': color[1],
@@ -39,11 +41,11 @@
     location <%(lx)f, %(ly)f, %(lz)f>
     look_at <%(atx)f, %(aty)f, %(atz)f>
 }\n''' % { 'lx':  pos.x,
-           'ly':  pos.y,
-           'lz':  pos.z,
+           'ly':  pos.z,
+           'lz':  pos.y,
            'atx': at.x,
-           'aty': at.y,
-           'atz': at.z }
+           'aty': at.z,
+           'atz': at.y }
 
 def spotlight(pos, at):
     return '''
@@ -53,9 +55,9 @@
     spotlight
     point_at <%(atx)f, %(aty)f, %(atz)f>
 }\n''' % { 'lx':  pos.x,
-           'ly':  pos.y,
-           'lz':  pos.z,
+           'ly':  pos.z,
+           'lz':  pos.y,
            'atx': at.x,
-           'aty': at.y,
-           'atz': at.z }
+           'aty': at.z,
+           'atz': at.y }