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
OpenSceneGraph 3.0: Beginner's Guide

You're reading from   OpenSceneGraph 3.0: Beginner's Guide This book is a concise introduction to the main features of OpenSceneGraph which then leads you into the fundamentals of developing virtual reality applications. Practical instructions and explanations accompany you every step of the way.

Arrow left icon
Product type Paperback
Published in Dec 2010
Publisher Packt
ISBN-13 9781849512824
Length 412 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

Table of Contents (22) Chapters Close

OpenSceneGraph 3.0
Credits
1. Foreword
About the Authors
2. Acknowledgement
About the Reviewers
3. www.PacktPub.com
4. Preface
1. The Journey into OpenSceneGraph FREE CHAPTER 2. Compilation and Installation of OpenSceneGraph 3. Creating Your First OSG Program 4. Building Geometry Models 5. Managing Scene Graph 6. Creating Realistic Rendering Effects 7. Viewing the World 8. Animating Scene Objects 9. Interacting with Outside Elements 10. Saving and Loading Files 11. Developing Visual Components 12. Improving Rendering Efficiency Pop quiz—Answers Index

Animating the transformation nodes


Path animations are the most commonly-used animations in graphics applications. They can be used to describe a running car, a flight, a rotating ball, or the camera's motion. The path should always be set up first, including position, rotation, and scale values at different key time nodes. When the simulation loop is running, a transition state is calculated every frame, using the linear interpolation for position and scale vectors, and spherical linear interpolation for the rotation quaternion. The slerp() method of osg::Quat is used internally here.

OSG provides the osg::AnimationPath class to encapsulate a time varying transformation path. It has an insert() method that can be used to insert a control point at a specific time. A control point, declared by the osg::AnimationPath::ControlPoint class, accepts a position value, and optional rotation and scale values in order to construct the animation path. For example:

osg::ref_ptr<osg::AnimationPath...
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 $19.99/month. Cancel anytime