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

Animating textures


Many great effects found in games can be achieved using very simple measures. The effect you will learn about in this recipe falls into this category. Animated textures are used very often to create the illusion of a flowing lava stream, waves on a lake, or details like a transparent plasma container mounted onto an alien gun.

This recipe will teach you how to put a texture onto an object and animate its position, scale, and rotation.

Getting ready

Please make sure you completed the recipe Setting up the game structure found in Chapter 1 before proceeding with the following steps. Also be sure to add a folder called textures to the project's folder structure and add it to Panda3D's content search paths, and have a texture file in PNG format at hand that can be used for this sample.

How to do it...

Follow these steps to complete this recipe:

  1. Copy your texture file to the textures directory and rename it to texture.png.

  2. Open Application.py and add the following code:

    from direct...