We'll be putting the sky sphere in the track class since it's a piece of scenery, technically.
Open
TrackClass_01.py
.Resave the file as
TrackClass_02.py
.Let's just dive right in, now. Add these two methods to the very bottom of the
Track
class:def setupSkySphere(self): self.skySphere = loader.loadModel( "../Models/LinearPinkSkySphere.bam") self.skySphere.reparentTo(render) self.skySphere.setBin('background', 1) self.skySphere.setDepthWrite(False) self.skySphere.setShaderOff() self.skySphere.setAlphaScale(0) taskMgr.add(self.skySphereTask, "SkySphere Task") return def skySphereTask(self, task): self.skySphere.setPos(base.camera, 0, 0, 0) return task.cont
Right beneath the call to
setupLight
in the__init__
method, add a call tosetupSkySphere
:self.setupSkySphere()
Save the file then change
WorldClass_02.py
to useTrackClass_02.py
. Once you've made the change, resave theWorld
class file asWorldClass_03...