示例#1
0
import os.path
from renmas3.base import load_image, save_image
from renmas3.win32 import show_image_in_window

fname = 'lena2.ppm'
filename = os.path.join(os.path.dirname(os.path.abspath(__file__)), fname)
print(filename)
img = load_image(filename)
print(img)

show_image_in_window(img)

fname = "lena3.ppm"
filename = os.path.join(os.path.dirname(os.path.abspath(__file__)), fname)
save_image(filename, img)
示例#2
0
import os.path
from renmas3.base import load_image, save_image
from renmas3.win32 import show_image_in_window

fname = "lena2.ppm"
filename = os.path.join(os.path.dirname(os.path.abspath(__file__)), fname)
print(filename)
img = load_image(filename)
print(img)

show_image_in_window(img)

fname = "lena3.ppm"
filename = os.path.join(os.path.dirname(os.path.abspath(__file__)), fname)
save_image(filename, img)
示例#3
0
#ren.parse_scene_file('../scenes/cornel4.txt')
#ren.parse_scene_file('../scenes/cube.txt')
#ren.parse_scene_file('../scenes/dragon.txt')
#ren.parse_scene_file('../scenes/dielectric.txt')
ren.parse_scene_file('../scenes/dielectric2.txt')

#ren.parse_scene_file('F:/ray_tracing_scenes/mitsuba_material/scene.txt')
#ren.parse_scene_file('F:/ray_tracing_scenes/san-miguel/scene.txt')
#ren.open_project('scene1.proj')

start = time.clock()
ren.prepare()
end = time.clock() - start
print ("Prezivili pripremu. Priprema trajala %f" % end)

start = time.clock()
ret = False
frame_pass = 0
while not ret:
    ret = ren.render()
    frame_pass += 1
    print("Frame number %i" % frame_pass)
print(time.clock() - start)

ren.save_project('scene1.proj')
img2 = ren.output_image()
show_image_in_window(img2)

save_image('picture.png', img2)
示例#4
0
# ren.parse_scene_file('../scenes/cornel4.txt')
# ren.parse_scene_file('../scenes/cube.txt')
# ren.parse_scene_file('../scenes/dragon.txt')
# ren.parse_scene_file('../scenes/dielectric.txt')
ren.parse_scene_file("../scenes/dielectric2.txt")

# ren.parse_scene_file('F:/ray_tracing_scenes/mitsuba_material/scene.txt')
# ren.parse_scene_file('F:/ray_tracing_scenes/san-miguel/scene.txt')
# ren.open_project('scene1.proj')

start = time.clock()
ren.prepare()
end = time.clock() - start
print("Prezivili pripremu. Priprema trajala %f" % end)

start = time.clock()
ret = False
frame_pass = 0
while not ret:
    ret = ren.render()
    frame_pass += 1
    print("Frame number %i" % frame_pass)
print(time.clock() - start)

ren.save_project("scene1.proj")
img2 = ren.output_image()
show_image_in_window(img2)

save_image("picture.png", img2)