Exemplo n.º 1
0
matsh = pi3d.Shader("mat_reflect")
flatsh = pi3d.Shader("uv_flat")

#Create textures
shapeimg = pi3d.Texture("textures/straw1.jpg")
shapebump = pi3d.Texture("textures/straw1.jpg", normal_map=-6.0)
waterbump = []
iFiles = glob.glob("textures/water/n_norm???.png")
iFiles.sort()  # order is vital to animation!
for f in iFiles:
    waterbump.append(pi3d.Texture(f))
num_n = len(waterbump)
shapeshine = pi3d.Texture("textures/stars.jpg")

#Create shape
myshape = pi3d.MergeShape()
num = (2, 2)
asphere = pi3d.Sphere(sides=32)
for i in range(num[0]):
    for j in range(num[1]):
        myshape.add(asphere, -num[0] * 0.9 + 1.8 * i, -num[1] * 0.9 + 1.8 * j,
                    0.0)

myshape.position(0.0, 0.0, 5)
myshape.set_draw_details(shader, [shapeimg, shapebump, shapeshine], 1.0, 0.1)

mywater = pi3d.LodSprite(w=250.0, h=250.0, n=6)
mywater.set_draw_details(matsh, [waterbump[0], shapeshine], 14.0, 0.6)
mywater.set_material((0.1, 0.25, 0.3))
mywater.set_fog((0.4, 0.6, 0.8, 0.0), 100)
mywater.rotateToX(85.0)
Exemplo n.º 2
0
ortho_cam = pi3d.Camera(is_3d=False)  # 2d orthographic view camera

#setup textures, light position and initial model position
pi3d.Light((0, 5, 0))
#create shaders
shader = pi3d.Shader("uv_reflect")
flatsh = pi3d.Shader("uv_flat")
defocus = pi3d.Defocus()

#Create textures
shapeimg = pi3d.Texture("textures/straw1.jpg")
shapebump = pi3d.Texture("textures/floor_nm.jpg")
shapeshine = pi3d.Texture("textures/pong3.png")

#Create shape
myshape = pi3d.MergeShape(camera=persp_cam)  #specify perspective view
asphere = pi3d.Sphere(sides=16, slices=16)
myshape.radialCopy(asphere, step=72)
myshape.position(0.0, 0.0, 5.0)
myshape.set_draw_details(shader, [shapeimg, shapebump, shapeshine], 8.0, 0.1)

mysprite = pi3d.Sprite(w=10.0, h=10.0, camera=persp_cam)
mysprite.position(0.0, 0.0, 15.0)
mysprite.set_draw_details(flatsh, [shapebump])

tick = 0
next_time = time.time() + 2.0

#load ttf font and set the font colour to 'raspberry'
arialFont = pi3d.Font("fonts/NotoSerif-Regular.ttf", (221, 0, 170, 255),
                      add_codepoints=[256])
Exemplo n.º 3
0
# Create elevation map
mapwidth = 1000.0
mapdepth = 1000.0
mapheight = 60.0
mountimg1 = pi3d.Texture("textures/mountains3_512.jpg")
mymap = pi3d.ElevationMap("textures/mountainsHgt.jpg", name="map",
                     width=mapwidth, depth=mapdepth, height=mapheight,
                     divx=32, divy=32) #testislands.jpg
mymap.set_draw_details(shader, [mountimg1, bumpimg, reflimg], 128.0, 0.0)
mymap.set_fog(*FOG)

#Create tree models
treeplane = pi3d.Plane(w=4.0, h=5.0)

treemodel1 = pi3d.MergeShape(name="baretree")
treemodel1.add(treeplane.buf[0], 0,0,0)
treemodel1.add(treeplane.buf[0], 0,0,0, 0,90,0)

treemodel2 = pi3d.MergeShape(name="bushytree")
treemodel2.add(treeplane.buf[0], 0,0,0)
treemodel2.add(treeplane.buf[0], 0,0,0, 0,60,0)
treemodel2.add(treeplane.buf[0], 0,0,0, 0,120,0)

#Scatter them on map using Merge shape's cluster function
mytrees1 = pi3d.MergeShape(name="trees1")
mytrees1.cluster(treemodel1.buf[0], mymap,0.0,0.0,200.0,200.0,20,"",8.0,3.0)
mytrees1.set_draw_details(flatsh, [tree2img], 0.0, 0.0)
mytrees1.set_fog(*TFOG)

mytrees2 = pi3d.MergeShape(name="trees2")
Exemplo n.º 4
0
mymap = pi3d.ElevationMap(mapfile="textures/mars_height.png",
                          width=mapwidth,
                          depth=mapdepth,
                          height=mapheight,
                          divx=128,
                          divy=128)
mymap.set_draw_details(bumpsh, [mountimg1, bumpimg], 128.0, 0.0)
mymap.set_fog((0.3, 0.15, 0.1, 0.7), 700.0)

#create robot
metalimg = pi3d.Texture("textures/metalhull.jpg")
robot_head = pi3d.Sphere(radius=1.0)
robot_body = pi3d.Cylinder(radius=1.0, height=2.0, sides=12)
robot_leg = pi3d.Cuboid(w=0.35, h=2.0)

robot = pi3d.MergeShape()
robot.add(robot_head.buf[0], 0.0, 1.6)
robot.add(robot_body.buf[0], 0.0, 0.5)
robot.add(robot_leg.buf[0], -1.04, 0, 0)
robot.add(robot_leg.buf[0], 1.05, 0, 0)
robot.set_draw_details(shader, [metalimg, metalimg, reflcn], 0.0, 0.5)

#create space station
ssphere = pi3d.Sphere(radius=10, slices=16, sides=16)
scorrid = pi3d.Cylinder(radius=4, height=22)

station = pi3d.MergeShape(y=mymap.calcHeight(0, 0), rx=4, ry=4, rz=4)
station.add(ssphere.buf[0], -20, 0, 20)
station.add(ssphere.buf[0], 20, 0, 20)
station.add(ssphere.buf[0], 20, 0, -20)
station.add(ssphere.buf[0], -20, 0, -20)
Exemplo n.º 5
0
    15: ['phosphorus', 1.5 / scaleDownFactorAtom, (1.0, 0.0, 1.0)]
}

shape1 = pi3d.Sphere(radius=atoms[6][1], y=2.5)

empty = pi3d.Triangle(corners=((-0.01, 10.0), (0.0, 0.01), (0.01, 0.0)),
                      z=10.0)

elem = {}

#made some changes here to make the elem variable a list so that each individual set of atoms can be manipulated later on
#otherwise the elem variable will overwrite itself on each atom iteration and only the last set will be manipulable
for e in atoms:
    if e != 6:  # don't do carbon again
        shape1 = pi3d.Sphere(radius=atoms[e][1])
        elem[e] = pi3d.MergeShape()

        for i in range(n):
            if element[i] == e:
                elem[e].add(shape1, x[i] / scaleDownFactor,
                            y[i] / scaleDownFactor, z[i] / scaleDownFactor)
        elem[e].set_material(atoms[e][2])
        #move the elem on the Y access so that it will be moved to a good location on the screen for the pyramid
        elem[e].positionY(2.0)
        empty.add_child(elem[e])

keys = pi3d.Keyboard()
mouse = pi3d.Mouse(restrict=False)
mouse.start()

# rotations for camera views ry, rz
                    z=0)  #child has z = 0
#myglass.set_alpha(0.4)
#myglass.set_material((0.1,0.1,0.1))
#myglass.set_draw_details(matl, [], 0.0, 1.0)

mybottom = pi3d.Cylinder(radius=0.3, height=0.05, sides=30, y=0, x=0, z=0)

#mybottom.set_draw_details(shinesh, [], 0.0, 0.5)

mywater = pi3d.Cylinder(
    radius=0.295, sides=30, height=0.7, y=0.1,
    x=0.1)  #y= (glassheight - waterheight / 2) - bottomheight
mywater.set_alpha(0.7)
mywater.set_material((0, 0, 0.7))
mywater.set_draw_details(matl, [test], 0, 1)
mymerge = pi3d.MergeShape(CAMERA3D, x=0, y=0, z=2)
mymerge.add(myglass, 0.1)
mymerge.add(mybottom, 0.1, 0.475, 0)

mymerge.set_alpha(0.7)
mymerge.set_material((0.1, 0.1, 0.1))
mymerge.set_draw_details(matl, [], 0.0, 1.0)
mymerge.add_child(mywater)
angle = 180

while DISPLAY.loop_running():

    slide.draw()
    mymerge.draw()

    angle += 1
Exemplo n.º 7
0
n = len(element)
'''NB if you download different molecules you might need to add to alter this.
 atomic number: name, radius, (r,g,b) tuple, Buffer num (NB this last value
 not used in the Molecule1 demo)'''
atoms = [[1, 'hydrogen', 0.5, (1.0, 0.0, 0.0), 0],
         [6, 'carbon', 0.8, (0.1, 0.1, 0.1), 1],
         [7, 'nitrogen', 0.9, (0.1, 0.9, 1.0), 2],
         [8, 'oxygen', 0.9, (1.0, 1.0, 1.0), 3],
         [15, 'phosphorus', 1.5, (1.0, 0.0, 1.0), 4]]

display = pi3d.Display.create(frames_per_second=30)
camera = pi3d.Camera()

ball = pi3d.Sphere()
ball.set_shader(pi3d.Shader('mat_light'))
molecule = pi3d.MergeShape(z=10)
molecule.set_fog((0.3, 0.2, 0.6, 0.05),
                 18.9)  # NB fog starts at 0.9 * 18.9, complete at 18.9

for a in atoms:
    ball.set_material(a[3])
    buflist = []
    for i in range(n):
        if a[0] == element[i]:
            # merge scale values used for atom size
            buflist.append([
                ball, x[i], y[i], z[i], 0.0, 0.0, 0.0, a[2], a[2], a[2], a[4]
            ])
    molecule.merge(buflist)

# Fetch key presses -------   w move nearer, s move away, esc quit -----
Exemplo n.º 8
0
mymap = pi3d.ElevationMap("textures/maze1.jpg",
                          width=mapwidth,
                          depth=mapdepth,
                          height=mapheight,
                          divx=128,
                          divy=128,
                          name="sub")
mymap.set_draw_details(shader, [rockimg1, rockimg2, shineimg], 128.0, 0.05)

# Create fog for more realistic fade in distance. This can be turned on and off between drawing different object (i.e backgound not foggy)
mymap.set_fog((0.1, 0.1, 0.1, 1.0), 200.0)

#Create tree models
treeplane = pi3d.Plane(w=4.0, h=5.0)

treemodel1 = pi3d.MergeShape(name="baretree")
treemodel1.add(treeplane.buf[0], 0, 0, 0)
treemodel1.add(treeplane.buf[0], 0, 0, 0, 0, 90, 0)

#Scatter them on map using Merge shape's cluster function
mytrees1 = pi3d.MergeShape(name="trees1")
mytrees1.cluster(treemodel1.buf[0], mymap, 0.0, 0.0, 900.0, 900.0, 10, "", 8.0,
                 3.0)
mytrees1.set_draw_details(shader, [tree2img, rockimg2], 4.0, 0.0)
mytrees1.set_fog((0.1, 0.1, 0.1, 1.0), 200.0)

raspberry = pi3d.MergeShape(name="rasp")
raspberry.cluster(treemodel1.buf[0], mymap, -250, +250, 470.0, 470.0, 5, "",
                  8.0, 1.0)
raspberry.set_draw_details(shader, [raspimg, raspimg], 1.0, 0.0)
raspberry.set_fog((0.1, 0.1, 0.1, 1.0), 200.0)
Exemplo n.º 9
0
mapheight = 80.0
mountimg1 = pi3d.Texture("textures/mountains3_512.jpg")
mymap = pi3d.ElevationMap("textures/mountainsHgt.png",
                          name="map",
                          width=mapsize,
                          depth=mapsize,
                          height=mapheight,
                          divx=32,
                          divy=32)
mymap.set_draw_details(shader, [mountimg1, bumpimg], 128.0, 0.0)
mymap.set_fog(*FOG)

# Create billboard trees
tree_sprite = pi3d.Sprite(w=hb2img.ix * 0.01,
                          h=hb2img.iy * 0.01)  # this isn't a square image
trees = pi3d.MergeShape()
trees.cluster(tree_sprite,
              mymap,
              0.0,
              0.0,
              300.0,
              600.0,
              1000,
              "",
              4.0,
              2.0,
              billboard=True)
trees.cluster(tree_sprite,
              mymap,
              150.0,
              300.0,
Exemplo n.º 10
0
  def __init__(self):

    # load shader
    shader = pi3d.Shader("uv_bump")
    #shinesh = pi3d.Shader("uv_reflect")
    flatsh = pi3d.Shader("uv_flat")

    tree1img = pi3d.Texture("../textures/tree1.png")
    tree2img = pi3d.Texture("../textures/tree2.png")
    hb2img = pi3d.Texture("../textures/hornbeam2.png")
    bumpimg = pi3d.Texture("../textures/grasstile_n.jpg")
    reflimg = pi3d.Texture("../textures/stars.jpg")
    floorimg = pi3d.Texture("../textures/floor_nm.jpg")

    FOG = ((0.3, 0.3, 0.4, 0.8), 650.0)
    TFOG = ((0.2, 0.24, 0.22, 1.0), 150.0)

    ectex=pi3d.loadECfiles("../textures/ecubes","sbox")
    self.myecube = pi3d.EnvironmentCube(size=900.0, maptype="FACES", name="cube")
    self.myecube.set_draw_details(flatsh, ectex)
    self.myecube.position(0,0,0)

    # Create elevation map
    mapsize = 1000.0
    mapheight = 60.0
    mountimg1 = pi3d.Texture("../textures/mountains3_512.jpg")
    self.mymap = pi3d.ElevationMap("../textures/mountainsHgt.png", name="map",
                         width=mapsize, depth=mapsize, height=mapheight,
                         divx=32, divy=32) 
    self.mymap.set_draw_details(shader, [mountimg1, bumpimg, reflimg], 128.0, 0.0)
    self.mymap.set_fog(*FOG)

    self.building = pi3d.Model(file_string="../models/ConferenceHall/conferencehall.egg", name="Hall", sx=0.1, sy=0.1, sz=0.1)
    self.building.set_shader(flatsh)

    #Create tree models
    treeplane = pi3d.Plane(w=4.0, h=5.0)

    treemodel1 = pi3d.MergeShape(name="baretree")
    treemodel1.add(treeplane.buf[0], 0,0,0)
    treemodel1.add(treeplane.buf[0], 0,0,0, 0,90,0)

    treemodel2 = pi3d.MergeShape(name="bushytree")
    treemodel2.add(treeplane.buf[0], 0,0,0)
    treemodel2.add(treeplane.buf[0], 0,0,0, 0,60,0)
    treemodel2.add(treeplane.buf[0], 0,0,0, 0,120,0)

    #Scatter them on map using Merge shape's cluster function
    self.mytrees1 = pi3d.MergeShape(name="trees1")
    self.mytrees1.cluster(treemodel1.buf[0], self.mymap,0.0,0.0,200.0,200.0,20,"",8.0,3.0)
    self.mytrees1.set_draw_details(flatsh, [tree2img], 0.0, 0.0)
    self.mytrees1.set_fog(*TFOG)

    self.mytrees2 = pi3d.MergeShape(name="trees2")
    self.mytrees2.cluster(treemodel2.buf[0], self.mymap,0.0,0.0,200.0,200.0,20,"",6.0,3.0)
    self.mytrees2.set_draw_details(flatsh, [tree1img], 0.0, 0.0)
    self.mytrees2.set_fog(*TFOG)

    self.mytrees3 = pi3d.MergeShape(name="trees3")
    self.mytrees3.cluster(treemodel2, self.mymap,0.0,0.0,300.0,300.0,20,"",4.0,2.0)
    self.mytrees3.set_draw_details(flatsh, [hb2img], 0.0, 0.0)
    self.mytrees3.set_fog(*TFOG)

    #screenshot number
    scshots = 1
Exemplo n.º 11
0
n = len(element)
'''NB if you download different molecules you might need to add to alter this.
 atomic number: name, radius, (r,g,b) tuple '''
atoms = {
    1: ['hydrogen', 0.5, (1.0, 0.0, 0.0)],
    6: ['carbon', 0.8, (0.1, 0.1, 0.1)],
    7: ['nitrogen', 0.9, (0.1, 0.9, 1.0)],
    8: ['oxygen', 0.9, (1.0, 1.0, 1.0)],
    15: ['phosphorus', 1.5, (1.0, 0.0, 1.0)]
}

display = pi3d.Display.create(frames_per_second=30)
camera = pi3d.Camera()

ball = pi3d.Sphere(radius=atoms[6][1])
carbon = pi3d.MergeShape(z=10)
for i in range(n):
    if element[i] == 6:
        carbon.add(ball, x[i], y[i], z[i])
carbon.set_material(atoms[6][2])
carbon.set_fog((0.3, 0.2, 0.6, 0.1), 18)

for e in atoms:
    if e != 6:  # don't do carbon again
        ball = pi3d.Sphere(radius=atoms[e][1])
        elem = pi3d.MergeShape()
        for i in range(n):
            if element[i] == e:
                elem.add(ball, x[i], y[i], z[i])
        elem.set_material(atoms[e][2])
        elem.set_fog((0.3, 0.2, 0.6, 0.05),
Exemplo n.º 12
0
class Main(object):
    # Setup display and initialise pi3d
    DISPLAY = pi3d.Display.create()
    pi3d.Light(lightpos=(1, -1, -3),
               lightcol=(1.0, 1.0, 0.8),
               lightamb=(0.25, 0.2, 0.3))
    # load shader
    shader = pi3d.Shader("uv_bump")
    shinesh = pi3d.Shader("uv_reflect")
    flatsh = pi3d.Shader("uv_flat")

    tree2img = pi3d.Texture("textures/tree2.png")
    tree1img = pi3d.Texture("textures/tree1.png")
    hb2img = pi3d.Texture("textures/hornbeam2.png")
    bumpimg = pi3d.Texture("textures/grasstile_n.jpg")
    reflimg = pi3d.Texture("textures/stars.jpg")
    rockimg = pi3d.Texture("textures/rock1.jpg")

    FOG = ((0.3, 0.3, 0.4, 0.8), 650.0)
    TFOG = ((0.2, 0.24, 0.22, 1.0), 150.0)

    #myecube = pi3d.EnvironmentCube(900.0,"HALFCROSS")
    ectex = pi3d.loadECfiles("textures/ecubes", "sbox")
    myecube = pi3d.EnvironmentCube(size=900.0, maptype="FACES", name="cube")
    myecube.set_draw_details(flatsh, ectex)

    # Create elevation map
    mapsize = 1000.0
    mapheight = 60.0
    mountimg1 = pi3d.Texture("textures/mountains3_512.jpg")
    mymap = pi3d.ElevationMap("textures/mountainsHgt.png",
                              name="map",
                              width=mapsize,
                              depth=mapsize,
                              height=mapheight,
                              divx=32,
                              divy=32)
    mymap.set_draw_details(shader, [mountimg1, bumpimg, reflimg], 128.0, 0.0)
    mymap.set_fog(*FOG)

    #Create tree models
    treeplane = pi3d.Plane(w=4.0, h=5.0)

    treemodel1 = pi3d.MergeShape(name="baretree")
    treemodel1.add(treeplane.buf[0], 0, 0, 0)
    treemodel1.add(treeplane.buf[0], 0, 0, 0, 0, 90, 0)

    treemodel2 = pi3d.MergeShape(name="bushytree")
    treemodel2.add(treeplane.buf[0], 0, 0, 0)
    treemodel2.add(treeplane.buf[0], 0, 0, 0, 0, 60, 0)
    treemodel2.add(treeplane.buf[0], 0, 0, 0, 0, 120, 0)

    #Scatter them on map using Merge shape's cluster function
    mytrees1 = pi3d.MergeShape(name="trees1")
    mytrees1.cluster(treemodel1.buf[0], mymap, 0.0, 0.0, 200.0, 200.0, 20, "",
                     8.0, 3.0)
    mytrees1.set_draw_details(flatsh, [tree2img], 0.0, 0.0)
    mytrees1.set_fog(*TFOG)

    mytrees2 = pi3d.MergeShape(name="trees2")
    mytrees2.cluster(treemodel2.buf[0], mymap, 0.0, 0.0, 200.0, 200.0, 20, "",
                     6.0, 3.0)
    mytrees2.set_draw_details(flatsh, [tree1img], 0.0, 0.0)
    mytrees2.set_fog(*TFOG)

    mytrees3 = pi3d.MergeShape(name="trees3")
    mytrees3.cluster(treemodel2, mymap, 0.0, 0.0, 300.0, 300.0, 20, "", 4.0,
                     2.0)
    mytrees3.set_draw_details(flatsh, [hb2img], 0.0, 0.0)
    mytrees3.set_fog(*TFOG)

    #Create monument
    monument = pi3d.Model(file_string="models/pi3d.obj", name="monument")
    monument.set_shader(shinesh)
    monument.set_normal_shine(bumpimg, 16.0, reflimg, 0.4)
    monument.set_fog(*FOG)
    monument.translate(100.0, -mymap.calcHeight(100.0, 235) + 12.0, 235.0)
    monument.scale(20.0, 20.0, 20.0)
    monument.rotateToY(65)

    #avatar camera
    rot = 0.0
    tilt = 0.0
    avhgt = 3.5
    xm = 0.0
    zm = 0.0
    ym = mymap.calcHeight(xm, zm) + avhgt

    go_flag = False
    go_speed = 0.2

    CAMERA = pi3d.Camera.instance()

    def pi3dloop(self, dt):
        self.DISPLAY.loop_running()
        self.CAMERA.reset()
        self.CAMERA.rotate(self.tilt, self.rot, 0)
        self.CAMERA.position((self.xm, self.ym, self.zm))
        self.myecube.position(self.xm, self.ym, self.zm)

        # for opaque objects it is more efficient to draw from near to far as the
        # shader will not calculate pixels already concealed by something nearer
        self.myecube.draw()
        self.mymap.draw()
        dx = math.copysign(self.mapsize, self.xm)
        dz = math.copysign(self.mapsize, self.zm)
        mid = 0.3 * self.mapsize
        if abs(self.xm) > mid:  #nearing edge
            self.mymap.position(dx, 0.0, 0.0)
            self.mymap.draw()
        if abs(self.zm) > mid:  #other edge
            self.mymap.position(0.0, 0.0, dz)
            self.mymap.draw()
            if abs(self.xm) > mid:  #i.e. in corner, both edges
                self.mymap.position(dx, 0.0, dz)
                self.mymap.draw()
        self.mymap.position(0.0, 0.0, 0.0)
        self.monument.draw()
        self.mytrees1.draw()
        self.mytrees2.draw()
        self.mytrees3.draw()

        if pi3d.PLATFORM == PLATFORM_ANDROID:  #*****************************
            if self.DISPLAY.android.screen.moved:
                self.rot -= self.DISPLAY.android.screen.touch.dx * 0.25
                self.tilt += self.DISPLAY.android.screen.touch.dy * 0.25
                self.DISPLAY.android.screen.moved = False
                self.DISPLAY.android.screen.tapped = False
            elif self.DISPLAY.android.screen.tapped:
                self.go_speed *= 1.5
                self.DISPLAY.android.screen.tapped = False
            elif self.DISPLAY.android.screen.double_tapped:
                self.go_flag = not self.go_flag
                self.DISPLAY.android.screen.double_tapped = False
        else:
            mx, my = self.mymouse.position()

            #if mx>display.left and mx<display.right and my>display.top and my<display.bottom:
            self.rot -= (mx - self.omx) * 0.2
            self.tilt += (my - self.omy) * 0.2
            self.omx = mx
            self.omy = my

            #Press ESCAPE to terminate
            k = self.mykeys.read()
            if k > -1:
                if k == ord('w'):  #key W
                    self.go_flag = not self.go_flag
                elif k == 27:  #Escape key
                    return False

        if self.go_flag:
            self.xm -= math.sin(math.radians(self.rot)) * self.go_speed
            self.zm += math.cos(math.radians(self.rot)) * self.go_speed
            self.ym = self.mymap.calcHeight(self.xm, self.zm) + self.avhgt
            halfmap = self.mapsize / 2.0  # save doing this four times!
            self.xm = (self.xm + halfmap) % self.mapsize - halfmap
            self.zm = (self.zm + halfmap) % self.mapsize - halfmap

        else:
            self.go_speed = 0.2
        return True

    def run(self):
        if pi3d.PLATFORM == PLATFORM_ANDROID:  #*****************************
            self.DISPLAY.android.set_loop(self.pi3dloop)
            self.DISPLAY.android.run()
        else:
            # Fetch key presses
            self.mykeys = pi3d.Keyboard()
            self.mymouse = pi3d.Mouse(restrict=False)
            self.mymouse.start()
            self.omx, self.omy = self.mymouse.position()
            while self.pi3dloop(0.0):
                pass
            self.mykeys.close()
            self.mymouse.stop()

        self.DISPLAY.stop()