Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Panda3D 1.6 Game Engine Beginner's Guide

You're reading from   Panda3D 1.6 Game Engine Beginner's Guide This is the A-Z of Panda3D for developers who have never used the engine before. Step-by-step, it takes you from first principles to ultimately creating a marketable game. You‚Äôll learn through first-hand experience and clear explanations.

Arrow left icon
Product type Paperback
Published in Feb 2011
Publisher Packt
ISBN-13 9781849512725
Length 356 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Toc

Table of Contents (22) Chapters Close

Panda3D 1.6 Game Engine
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Installing Panda3D and Preparing a Workspace 2. Creating the Universe: Loading Terrain FREE CHAPTER 3. Managing Tasks Over Time 4. Taking Control: Events and User Input 5. Handling Large Programs with Custom Classes 6. The World in Action: Handling Collisions 7. Making it Fancy: Lighting, Textures, Filters, and Shaders 8. GUI Goodness: All About the Graphic User Interface 9. Animating in Panda3D 10. Creating Weaponry: Using Mouse Picking and Intervals 11. What's that Noise? Using Sound 12. Finishing Touches: Getting the Game Ready for the Customer Creating a Sky Sphere with Spacescape Using Egg-Texture-Cards and ExploTexGen Pop quiz Answers Index

Utilizing mouse input and creating camera control


The keyboard isn't the only piece of hardware we can get input from. Mouse-clicks also trigger events and we use the same methods to respond to them. The event names for the mouse buttons are:

  • "mouse1": Left mouse button

  • "mouse2": Middle mouse button

  • "mouse3": Right mouse button

Like keyboard keys, the mouse events also have versions that we can take advantage of.

In order to make use of the mouse, we first have to disable the default mouse camera control. For that, we turn back to our old friend base. The method base.disableMouse() has a deceptive name, because it doesn't actually turn off mouse input. Instead, it removes the camera control scheme that Panda3D uses by default, and allows us to use the mouse for other things, and to control the camera with our own code.

Once we've called the base.disableMouse() method, we can access the camera by manipulating the NodePath that points to it. For the default camera, that NodePath is base.camera.

lock icon The rest of the chapter is locked
Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Panda3D 1.6 Game Engine Beginner's Guide
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime
Modal Close icon
Modal Close icon