This recipe will show you how to enable and use cube mapping to make your models and actors dynamically reflect any other game objects and the surrounding environment. This is a very useful effect for emphasizing movement by creating a glossy car paint effect in a racing game, for example.
This recipe requires you to have finished the steps of the recipe Setting up the game structure found in Chapter 1 and will follow up to where this recipe left off.
These are the tasks for this recipe:
In the file
Application.py
, add the following code:from direct.showbase.ShowBase import ShowBase from panda3d.core import * from direct.interval.IntervalGlobal import * class Application(ShowBase): def __init__(self): ShowBase.__init__(self) self.world = loader.loadModel("environment") self.world.reparentTo(render) self.world.setScale(0.5) self.world.setPos(-8, 80, 0) self.teapot = loader.loadModel...