demos/bunny.py
branchpyrit
changeset 46 6493fb65f0b1
parent 40 929aad02c5f2
child 60 a23b5089b9c3
equal deleted inserted replaced
45:76b254ce92cf 46:6493fb65f0b1
    16 mat = Material(colour=(0.9, 0.9, 0.9))
    16 mat = Material(colour=(0.9, 0.9, 0.9))
    17 mat.setTransmissivity(0.8)
    17 mat.setTransmissivity(0.8)
    18 LoadStanfordPlyFile(rt, "../models/bunny/bun_zipper.ply",
    18 LoadStanfordPlyFile(rt, "../models/bunny/bun_zipper.ply",
    19 	mat, smooth=True, scale=(-29.0, 29.0, 29.0), trans=(-1,-2.5,-3))
    19 	mat, smooth=True, scale=(-29.0, 29.0, 29.0), trans=(-1,-2.5,-3))
    20 
    20 
    21 mat0 = Material(colour=(0.1, 0.2, 1.0))
    21 mat0 = Material(colour=(0.1, 0.2, 0.6))
    22 box1 = Box(L=(-20.0, -1.7, -20.0), H=(20.0, -1.5, 20.0), material=mat0)
    22 box1 = Box(L=(-20.0, -1.7, -20.0), H=(20.0, -1.5, 20.0), material=mat0)
    23 rt.addshape(box1)
    23 rt.addshape(box1)
    24 
    24 
    25 mat1 = Material(colour=(0.5, 0.2, 0.1))
    25 mat1 = Material(colour=(0.5, 0.5, 0.2))
    26 mat1.setReflectivity(0.0)
    26 mat1.setReflectivity(0.0)
    27 box2 = Box(L=(-20.0, -20.0, -10.0), H=(20.0, 20.0, -12.0), material=mat1)
    27 box2 = Box(L=(-20.0, -20.0, -10.0), H=(20.0, 20.0, -12.0), material=mat1)
    28 rt.addshape(box2)
    28 rt.addshape(box2)
    29 
    29 
    30 light = Light(position=(-5.0, 3.0, 10.0), colour=(0.9, 0.3, 0.6))
    30 light = Light(position=(-5.0, 3.0, 10.0), colour=(0.8, 0.5, 0.6))
    31 #light.castshadows(0)
    31 #light.castshadows(0)
    32 rt.addlight(light)
    32 rt.addlight(light)
    33 
    33 
    34 light2 = Light(position=(4.0, 1.0, 10.0), colour=(0.2, 0.9, 0.5))
    34 light2 = Light(position=(4.0, 1.0, 10.0), colour=(0.5, 0.55, 0.7))
    35 #light2.castshadows(0)
    35 #light2.castshadows(0)
    36 rt.addlight(light2)
    36 rt.addlight(light2)
    37 
    37 
    38 imagesize = (800, 600)
    38 imagesize = (800, 600)
    39 data = rt.render(imagesize)
    39 data = rt.render(imagesize)