O'Reilly logo

Panda3D 1.6 Game Engine by Dave Mathews

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action - creating the sky sphere in Panda3D

Next, we'll create a sky sphere writing tool that we can use to create sky sphere bam files.

  1. Open a new file in Notepad++. Type the following two lines at the top:
    import direct.directbase.DirectStart
    from pandac.PandaModules import *
    
  2. Next, we'll define a new class and its __init__ method:
    class SkySphereWriter:
    def __init__(self):
    
  3. After that, we'll load the skybox as a cubemap and also load the inverted sphere, which is a normal 1 unit sphere, except that the faces point inward instead of outward. The # sign in the first line is replaced with the numbers 0 through 5 when Panda3D loads the cubemap.
    self.texture = loader.loadCubeMap("../Images/Purple_#.png") self.sphere = loader.loadModel("InvertedSphere.egg") ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required