Book Image

Panda3D 1.7 Game Developer's Cookbook

Book Image

Panda3D 1.7 Game Developer's Cookbook

Overview of this book

Table of Contents (20 chapters)
Panda3D 1.7 Game Developer's Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Changing a model's render attributes


One of the big strengths of Panda3D is its nice and clever programming interface that allows us to quickly put together scenes by loading and placing models and actors. Getting something rendered onto the screen works amazingly fast and easy.

Beyond this simple programming interface lies a very advanced renderer that takes the information from the current scene graph and draws the models and actors found in there to the screen. The way this rendering subsystem draws geometry can be changed by setting some render attributes, which we will explore in this recipe.

Getting ready

This recipe requires a project setup as described in Setting up the game structure found in Chapter 1, Setting Up Panda3D and Configuring Development Tools. Please revisit these instructions before proceeding with this tip.

How to do it...

Let's see how Panda3D allows you to change render attributes:

  1. Open Application.py and replace its content with the following code:

    from direct.showbase...