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

Switch nodes


The osg::Switch node is able to render or skip specific children conditionally. It inherits the methods of osg::Group super class and attaches a Boolean value to each child node. It has a few useful public methods:

  1. The overloaded addChild() method is able to have a Boolean parameter in addition to the osg::Node pointer. When the Boolean parameter is set to false, the added node will be invisible to the viewer.

  2. The setValue() method will set the visibility value of the child node at the specified index. It has two parameters: the zero-based index and the Boolean value. And getValue() can get the value of child node at the input index.

  3. The setNewChildDefaultValue() method sets the default visibility for new children. If a child is simply added without specifying a value, its value will be decided by setNewChildDefaultValue(), for instance:

    switchNode->setNewChildDefaultValue( false );
    switchNode->addChild( childNode ); // Turned off by default now!
    
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