Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Papervision3D Essentials

You're reading from  Papervision3D Essentials

Product type Book
Published in Sep 2009
Publisher Packt
ISBN-13 9781847195722
Pages 428 pages
Edition 1st Edition
Languages

Table of Contents (18) Chapters

Papervision3D Essentials
Credits
About the Authors
About the Reviewers
1. Preface
1. Setting Up 2. Building Your First Application 3. Primitives 4. Materials 5. Cameras 6. Moving Things Around 7. Shading 8. External Models 9. Z-Sorting 10. Particles 11. Filters and Effects 12. 3D Vector Drawing and Text 13. Optimizing Performance

Mouse interaction


There are several ways one can interact with Flash and Papervision3D applications. In this chapter, we will focus on mouse interaction and keyboard interaction. We will deal with keyboard interaction in the example at the end of this chapter. However, in this section, we will discuss some mouse interaction tricks—short pieces of code that you simply can put in the render method. When the user moves the mouse, this code will animate the camera or the object(s) in your scene. We will also take a look at how to orbit the camera around an object. Orbiting is moving the camera around an object over spherical coordinates, while keeping a constant distance to the object.

In order to demonstrate a sample of mouse interaction techniques, we will create a template class on which we will base the examples. Because we will make the mouse interact with a grid of planes, we will first build a grid as shown in the following screenshot:

Place the following code in your document class...

lock icon The rest of the chapter is locked
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 €14.99/month. Cancel anytime}