[Edu-sig] python satacad: class 4

Kirby Urner urnerk at qwest.net
Sun Feb 6 05:00:47 CET 2005


Mostly just played with POV-Ray today, including projected images of award
winning master works, even an animation.

Python angle is to take a standard scene out of POV-Ray, use triple-quote
syntax and then pick some aspect of the scene to change using substitution
from a dictionary, i.e. 

myscene = """
blah blah %(key1)s 
blah 
%(key2)s
"""

Mydict = { "key1":value1, "key2":value2 }

h = open('thefile.pov','w')
h.write(myscene % mydict)
h.close()

except a bit more structured than that (using functions with parameters and
stuff -- no class definitions today, purely procedural).

This built of "madlibs" we did last week, also involving triple quote
syntax.

Gave them lots of time to just explore, play around.  I'd walk around and
help with debugging.  I find a laser pointer is useful for pointing at
syntax on the monitor, without having to lean over to point and smudge. 

They developed some interesting scenes, using cylinders and such (another
Python template for that).  They were already pretty comfortable with XYZ,
and could adjust to POV-Rays setup: -Z coming out towards you, +X to the
right.

http://astronomy.swin.edu.au/~pbourke/geomformats/pov/s_57.html#s02_02_01_01

Two of the seven missing today, don't know why.  Attendance isn't mandatory
in any case.

We also got into texturing i.e. making our cylinders of gold or brass, on a
floor of stone.  Some of the scenes looked surreal in a Dali kind of way,
especially when applying the fish-eye camera.

I'd thought I'd be getting to GCD and EA (Euclidean Algorithm) today, but
I've been showing 'em eye candy and promising more right brained activities.
Today was a day to make good on those promises.  POV-Ray is awesome.

Kirby




More information about the Edu-sig mailing list