Kjells Figur
pythonfigur.py — Python Source, 2 KB (3047 bytes)
Dateiinhalt
# -*- coding: utf-8 -*- from visual import * figur = frame() koerper = ellipsoid(frame = figur, height = 1,length = 0.5, width = 0.5,pos = (0,0,0),color = color.red, material = materials.wood) hitbox = box(frame = figur, pos = (0,0,0),height = 3, width = 2, length = 2, opacity = 0.001) gesicht = pyramid(frame = figur ,pos= (-0.1,0.7,0),size = (0.75,0.3,0.5),color = color.red, material = materials.wood, axis = (1,-1,0)) beinlinks = curve(frame = figur ,pos=[(0,-0.2,0),(0.2,-0.8,0.1),(-0.25,-1.1,0.25)], radius = 0.08,color = color.red, material = materials.wood) beinrechts = curve(frame = figur ,pos=[(0,-0.2,0),(0.25,-0.8,-0.25),(0.25,-1.1,-0.25)], radius = 0.08,color = color.red, material = materials.wood) armlinks = curve(frame = figur ,pos=[(0,0.45,0),(0,0,0.3),(0.25,-0.3,0.25)], radius = 0.08,color = color.red, material = materials.wood) armlinks = curve(frame = figur ,pos=[(0,0.45,0),(0,0,-0.3),(0.25,-0.3,-0.25)], radius = 0.08,color = color.red,material = materials.wood) augelinks = sphere(frame = figur, pos = (0.1,0.7,0.1), radius = 0.05, material = materials.chrome,color = color.orange) augerechts = sphere(frame = figur, pos = (0.1,0.7,-0.1), radius = 0.05, material = materials.chrome,color = color.orange) ohrlinks = pyramid(frame = figur, pos = (-0.05,0.75,0.1), size = (0.35,0.1,0.1),axis = (-0.5,1,0), color = color.red, material = materials.wood) ohrrechts = pyramid(frame = figur, pos = (-0.05,0.75,-0.1), size = (0.35,0.1,0.1),axis = (-0.5,1,0), color = color.red, material = materials.wood) figur.pos =(0,0,0) ##class Figur1(frame): ## def __init__(self, farbe = color.white, groesse = 1, pos = (0,0,0)): ## frame.__init__(self) ## self.gross = sphere(frame = self,radius = groesse*4, material = materials.marble ) ## self.mittel = sphere(frame = self,radius = groesse*3, ## pos = (groesse*4,0,0)) ## self.klein = sphere (frame = self,radius = groesse*2, ## pos = (groesse*7,0,0)) ## self.nase = cone (frame = self,length = groesse*2, ## radius = groesse*0.5, ## width = groesse*0.5, ## pos = (groesse*7,groesse*-1.5,0), ## axis = (0,groesse*-1,0), ## color = color.orange) ## self.auge1 = sphere(frame = self,radius = groesse*0.2, ## pos = (groesse*7.8,groesse*-1.6,groesse*1), ## color = color.black) ## self.auge2 = sphere(frame = self,radius = groesse*0.2, ## pos = (groesse*7.8,groesse*-1.6,groesse*-1), ## color = color.black) ## ##frosty = Schneemann(groesse = 2) ##frosty.pos = (0,0,-14) ##maxi = Schneemann() ##frosty.material = materials.wood ##peter = Schneemann(groesse = 0.5) ##peter.pos = (0,0,7) ##for i in range (0,10): ## s = Schneemann() ## s.pos=(0,7,i*10)