Links und Funktionen
Sprachumschaltung

Navigationspfad


Inhaltsbereich

world1.2

KaptludoWorld.py — text/python-source, 2 KB (2232 bytes)

Dateiinhalt

from visual import *

scene.forward = (0,-3,0)
scene.center = (50,0,50)
ground = box(pos=(50,-0.5,50), length=100, height=0.1, width=100, material=materials.rough)
landscape = box(pos=(50,-0.5,50), length=101, height=30, width=101, material=materials.earth)

class house():    #class house
    def __init__(self, px, pz, pLength, pWidth, pcolor=color.cyan):                            #__init__
        a = box(pos=(px, 4.5, pz), length=pLength, height=10, width=pWidth, color=pcolor)
        b = curve(pos=[(px+0.5*pLength,0,pz+0.5*pWidth),(px-0.5*pLength,0,pz+0.5*pWidth),(px-0.5*pLength,0,pz-0.5*pWidth),(px+0.5*pLength,0,pz-0.5*pWidth),(px+0.5*pLength,0,pz+0.5*pWidth)])

#outer walls
wall1=house(50,0.5,100,1)
wall2=house(50,99.5,100,1)
wall3=house(0.5,50,1,100)
wall4=house(99.5,50,1,100)

#inner cross
house1=house(25,50,40,1)
house2=house(75,50,40,1)
house3=house(50,25,1,40)
house4=house(50,75,1,40)

#central walls
house5=house(43.25,40,7.5,1)
house6=house(56.75,40,7.5,1)
house7=house(43.25,60,7.5,1)
house8=house(56.75,60,7.5,1)
house9=house(40,43.25,1,7.5)
house10=house(60,43.25,1,7.5)
house11=house(40,56.75,1,7.5)
house12=house(60,56.75,1,7.5)

#sector I
bubble1 = sphere(pos=(65,1,15), radius=5, color = color.cyan)
bubble2 = sphere(pos=(75,-2,23), radius=7, color = color.cyan)
bubble3 = sphere(pos=(80,4.5,35), radius=5, color = color.cyan)
bubble4 = sphere(pos=(90,1,5), radius=6, color = color.cyan)
bubble5 = sphere(pos=(70,5.5,44), radius=6, color = color.cyan)
bubble6 = sphere(pos=(60,5,29), radius=5, color = color.cyan)
bubble7 = sphere(pos=(90,3,23), radius=5, color = color.cyan)
bubble8 = sphere(pos=(95,5,37), radius=7, color = color.cyan)


#sector II
dice1=house(34.5,47,6,6)
dice2=house(29.5,42,6,6)
dice3=house(40,34,6,6)
dice4=house(47,25,6,6)
dice5=house(42,15,6,6)
dice6=house(37,10,6,6)
dice7=house(34,25,6,6)
dice8=house(29,30,6,6)
dice9=house(25,15,6,6)
dice10=house(20,12,6,6)
dice11=house(15,17,6,6)
dice12=house(11,9,6,6)
dice13=house(11,29,6,6)
dice14=house(16,34,6,6)
dice15=house(11,39,6,6)

#main base circle
base =cylinder(pos=(50,-0.5,50), axis=(0,0.11,0), radius=0.5, material=materials.emissive, color=color.red, opacity=0.3)
baselamp = local_light(pos=(50,2,50), color=color.red)

Funktionsleiste