demos/car.py
branchpyrit
changeset 59 64e456ab823d
parent 58 cfe98f5c0ae9
child 60 a23b5089b9c3
--- a/demos/car.py	Fri Apr 04 01:55:25 2008 +0200
+++ b/demos/car.py	Fri Apr 04 13:54:47 2008 +0200
@@ -3,15 +3,22 @@
 import sys
 sys.path.append(open('ModulePath').read().strip())
 
-from raytracer import Raytracer, Light, Sphere, Triangle, Material
+from raytracer import Raytracer, Light, Sphere, Triangle, Material, Camera
 from lworeader import LoadLightwaveLwoFile
 import Image
+from math import *
 
 rt = Raytracer()
+
+cam = Camera(eye=(0.,5.,8.))
+rotx=0.3
+cam.rotate((cos(rotx),-sin(rotx),0.,0.))
+rt.setcamera(cam)
+
 mat = Material(colour=(0.9, 0.9, 0.9))
-LoadLightwaveLwoFile(rt, "../models/car/Nissan300ZX.lwo",	mat, smooth=True, scale=0.4) #, , trans=(0,-3,0))
+LoadLightwaveLwoFile(rt, "../models/car/Nissan300ZX.lwo", mat, smooth=False, scale=0.4)
 
-light = Light(position=(-5.0, 2.0, 8.0), colour=(0.2, 0.4, 0.6))
+light = Light(position=(-5.0, 2.0, 8.0), colour=(0.7, 0.7, 0.7))
 rt.addlight(light)
 
 imagesize = (800, 600)