panorama.py
panorama.py — text/python-source, 1 KB (1531 bytes)
Dateiinhalt
# -*- coding: utf-8 -*- from visual import * # das 3D-Modul #-- Panamorama-Auskleidung einer Kugel --------------------- import Image #name = "pano_olympia_aussen" #name = "pano_solarberg" #name = "pano_siegburg" #name = "pano_waldeck" name = "siegwehr" #name = "pano_notting-hill" width = 2048 # Breite und Höhe an Original anpassen height = 1024 im = Image.open(name+".tga") # Öffnen des Bildes materials.saveTGA(name,im) # Speichern des Bildes intern pano = materials.texture(data=im, mapping="spherical") # Darstellungsart #-- Neutrale Umleuchtung mit 8 Lichtern -------------------- scene.lights = [distant_light(direction=( 10, 10, 10), color=color.gray(0.5)),\ distant_light(direction=(-10, 10, 10), color=color.gray(0.5)),\ distant_light(direction=( 10,-10, 10), color=color.gray(0.5)),\ distant_light(direction=( 10, 10,-10), color=color.gray(0.5)),\ distant_light(direction=(-10,-10, 10), color=color.gray(0.5)),\ distant_light(direction=( 10,-10,-10), color=color.gray(0.5)),\ distant_light(direction=(-10, 10,-10), color=color.gray(0.5)),\ distant_light(direction=(-10,-10,-10), color=color.gray(0.5))] #-- Kameraposition im Zentrum ------------------------------ scene.fov=pi/2 # Blickwinkel 90° (statt 60°) scene.range=0.001 # Entfernung zum Blickzentrum #panorama = sphere(material=pano)# Das Bild ansich sphere(material=pano)