openscenegraph 3.0

412 1.8K 0
openscenegraph  3.0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

www.it-ebooks.info OpenSceneGraph 3.0 Beginner's Guide Create high-performance virtual reality applicaons with OpenSceneGraph, one of the best 3D graphics engines Rui Wang Xuelei Qian BIRMINGHAM - MUMBAI www.it-ebooks.info OpenSceneGraph 3.0 Beginner's Guide Copyright © 2010 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmied in any form or by any means, without the prior wrien permission of the publisher, except in the case of brief quotaons embedded in crical arcles or reviews. Every eort has been made in the preparaon of this book to ensure the accuracy of the informaon presented. However, the informaon contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark informaon about all of the companies and products menoned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this informaon. First published: December 2010 Producon Reference: 1081210 Published by Packt Publishing Ltd. 32 Lincoln Road Olton Birmingham, B27 6PA, UK. ISBN 978-1-849512-82-4 www.packtpub.com Cover Image by Ed Maclean (edmaclean@gmail.com) www.it-ebooks.info Credits Authors Rui Wang Xuelei Qian Reviewers Jean-Sébasen Guay Cedric Pinson Acquision Editor Usha Iyer Development Editor Maitreya Bhakal Technical Editors Conrad Sardinha Vanjeet D'souza Indexers Tejal Daruwale Hemangini Bari Monica Ajmera Mehta Editorial Team Leader Akshara Aware Project Team Leader Lata Basantani Project Coordinator Leena Purkait Proofreader Dirk Manuel Graphics Nilesh Mohite Producon Coordinator Adline Swetha Jesuthas Cover Work Adline Swetha Jesuthas www.it-ebooks.info Foreword Scene graphs have been the foundaon of real-me graphics applicaons for the last two decades, whether it is a 3D game on a phone or a professional ight simulator cosng millions of pounds, a virtual reality applicaon through to the latest 3D real-me visualizaon on television, scene graphs are there under the hood, quietly churning out high quality visuals. However, even powerful tools like scene graphs don't write world leading graphics applicaons by themselves, they sll need developers with the skill and knowledge to make best use of them and the hardware that they run on. This experse isn't something that you can gain by reading a few pages on the web—graphics hardware and soware connues to evolve and you need to keep up with it It's a journey of learning and exploraon undertaken throughout your career. OpenSceneGraph itself is the world's leading scene graph API, and has been wrien by, and to full the needs of, professional graphics applicaon developers. It is wrien to be powerful and producve to use rather than cut down and easy to use. Your rst encounter with OpenSceneGraph may well be daunng; it's a professional grade scene graph containing many hundreds of classes and modules. But with this sophiscaon comes the ability to write very powerful graphics applicaons quickly so it's well worth the eort in learning how to make best use of it. The authors of this book are users and contributors to the OpenSceneGraph soware and its community. For me it's rewarding to see this open source project reach out across the world and inspire people, such as Rui Wang and Xuelei Qian, not only to use and contribute to the soware, but also to write a book about it so that others can start their own journey into real-me graphics. www.it-ebooks.info With this book their aim has been to take you from your rst steps through to being able to use advanced features of the OpenSceneGraph and the graphics hardware that it runs on. Learning new concepts and APIs can oen be dry and awkward, but once you get your rst applicaons on screen you'll glimpse the potenal, and it won't be long before you are seeing complex worlds come life. As a real-me graphics geek myself, I can't think anything more rewarding than immersing yourself in 3D worlds that you help create. Some familiarity with linear algebra, such like 3D vectors, quaternion numbers and matrix transformaons, is helpful, too. Robert Oseld. OpenSceneGraph Project Lead www.it-ebooks.info About the Authors Rui Wang is a soware engineer at the Chinese Academy of Surveying and Mapping and the manager of osgChina, the largest OSG discussion website in China. He is one of the most acve members of the ocial OSG community, who contributes to the serializaon I/O, GPU-based parcle funconalies, BVH and animated GIF plugins, and other xes and improvements to the OSG project. He translated Paul Martz's OpenSceneGraph Quick Start Guide into Chinese in 2008, and wrote his own Chinese book OpenSceneGraph Design and Implementaon in 2009, cooperang with Xuelei Qian. He is also a novel writer and a guitar lover. Xuelei Qian received his B.Sc. degree in Precision Instrument Engineering from Southeast University, Jiangsu, China, and his Ph.D. degree in applied graphic compung from the University of Derby, Derby, UK in 1998 and 2005, respecvely. Upon compleon of his Ph.D. degree, he worked as a postdoctoral research fellow in the Dept. of Precision Instrument and Mechanology at Tsinghua University and his current research interests include E-manufacturing, STEP-NC and intelligent CNC, and virtual reality engineering. www.it-ebooks.info Acknowledgement We'd like to rst thank Don Burns and Robert Oseld for their creave eorts in giving birth to OpenSceneGraph, as well as thousands of members in the OSG core community, for their supports and contribuons all the me. Thanks again to Robert Oseld, a pure open source enthusiast and father of a happy family, for his tremendous passion in leading the development the OSG project for so many years (since 1999). He also took me out of his busy schedule to write the foreword for this book. We must express our deep gratude to Rakesh Shejwal, Usha Iyer, Leena Purkait, Priya Mukherji, and the enre Packt Publishing team for their talented work in producing yet another product, as well as Jean-Sébasen Guay and Cedric Pinson for reviewing the rst dras of the book and providing insighul feedback. We would like to acknowledge John F. Richardson and Marek Teichmann, who announced the book at the OpenSceneGraph BOF at SIGGRAPH 2010. We also oer special thanks to Zhanying Wei, Xuexia Chen, Shixing Yang, Peng Xiao, Qingliang Liu, Su Jiang, and a number of other people who contributed to the compleon of this book in dierent ways. Finally, we owe the most sincere thanks to Paul Martz, who dedicates the rst non-commercial book to OSG beginners all over the world and provides great help in supporng the publicaon of our past and current books. www.it-ebooks.info About the Reviewers Jean-Sébasen Guay is a soware developer from Montréal, Quebec, Canada. Aer compleng a Bachelor's Degree in Soware Development and Soware Engineering at UQAM, he began a Master's Degree in Computer Graphics at École Polytechnique, where he chose to use OpenSceneGraph for his Master's project. Movated by the open nature of the project and wanng to contribute, he started learning its inner workings, xing bugs, improving the Windows build system, and helping others with their problems on the osg- users mailing list. He has been in the top three posters each month ever since. But is that a good thing or just an indicaon that he talks too much? Since late 2007, he has worked for CM-Labs Simulaons Inc. (http://www.vortexsim. com/ ), where he develops the Vortex physics toolkit and training simulators for various industries such as construcon, subsea, and others. Being the company's dedicated graphics developer allows him to connue using and contribung to OpenSceneGraph. The best part is he gets paid for it, too! Doing so has helped improve his prociency with C++ as well as allowed him to use other scene graphs such as Vega Prime and OpenSG, which lets him keep an open mind and always see the big picture. Jean-Sébasen has parcipated in several OpenSceneGraph user meengs, and he was a presenter at the OpenSceneGraph BOFs at Siggraph in 2008 and 2009. He is also a co-developer of the osgOcean nodekit, an ocean surface rendering add-on library for OpenSceneGraph, which is available at http://osgocean.googlecode.com/. He has also contributed to other open source projects, such as Bugzilla, Yafaray, and others. Jean-Sébasen currently lives in the suburbs of Montréal, with his lovely wife and their three young boys. His personal website can be found at http://whitestar02.webhop.org/. www.it-ebooks.info Cedric M. Pinson has twelve years of experience in 3D soware. He has worked in the video game industry at Nemoso and Mekensleep, before joining OutFlop, where he has served as the project leader for 3D client technology. He is a contributor to the OpenSceneGraph project and the author and maintainer of osgAnimaon. He now does freelance work around OpenGL technologies such as OpenSceneGraph and WebGL. I would like to thank my friends, Loic Dachary for helping me with his advice, Jeremy Moles for the movaon and comments about OpenSceneGraph, Johan Euphrosine for his support, Olivier Lejade who oered me a place to work, and Amy Jones who helps in many ways. www.it-ebooks.info [...]... yourself, and will have the ability to develop OpenSceneGraph -based applications and extend practical functionalities for your own purposes With plenty of examples to get you started quickly, you'll master developing with OpenSceneGraph in no time What this book covers Chapter 1, The Journey into OpenSceneGraph introduces the history, structure and features of OpenSceneGraph (OSG), and introduces the general... essential knowledge contained in this book, you will be able to start using OpenSceneGraph in your own projects and research fields, and extend its functionalities by referring to OpenSceneGraph' s source code, official examples, and API documentation This handy book divides the core functionalities of the proved and comprehensive OpenSceneGraph 3D graphics engine into different aspects, which are introduced... important field of OpenSceneGraph programming, along with several examples illustrating concrete usages and solutions The sequence of the chapters is organized from the easy topics to the more difficult concepts, to help you to gradually build your knowledge and skills in with OpenSceneGraph www.it-ebooks.info Preface By the end of the whole book, you will have gained a ready-to-use OpenSceneGraph development... structure and main functionalities of OpenSceneGraph, and guiding them to develop virtual-reality applications using this powerful 3D graphics engine This book covers the essence of OpenSceneGraph, providing programmers with detailed explanations and examples of scene graph APIs This book helps you take full advantages of the key features and functionalities of OpenSceneGraph You will learn almost all... Table of Contents Preface Chapter 1: The Journey into OpenSceneGraph 1 7 A quick overview of rendering middleware Scene graphs The Birth and development of OSG Components Why OSG? Who uses OSG? Have a quick taste Time for action – say "Hello World" OSG style Live in community Summary 8 8 9 10 12 13 14 14 15 17 Chapter 2: Compilation and Installation of OpenSceneGraph System requirements Using the installer... www.it-ebooks.info Preface Real-time rendering is in quite demand in computer science today, and OpenSceneGraph, being one of the best 3D graphics toolkits, is being used widely in the fields of virtual reality, scientific visualization, visual simulation, modeling, games, mobile applications, and so on Although you can use the powerful OpenSceneGraph, which is based on the low-level OpenGL API, to implement applications... having a problem with any aspect of the book, and we will do our best to address it [6] www.it-ebooks.info 1 The Journey into OpenSceneGraph Before looking into various rendering effects and playing with carefully selected code snippets, let us first get a glimpse of the history of OpenSceneGraph, learn about its structures and capabilities, and join a web community to learn and discuss OSG online You... chance to create a "Hello World" application in OSG style, through which you will gain necessary information about OSG's syntax and structure In this book, OSG is short for OpenSceneGraph It will be used from time to time to replace OpenSceneGraph' s full name, for convenience In this chapter, we will: ‹‹ Have a brief overview of the concept of scene graph and a history of OSG ‹‹ Look into the fundamental... a first-hand taste of OSG with a very simple example ‹‹ Establish a fast connection for interacting with the OSG community www.it-ebooks.info The Journey into OpenSceneGraph A quick overview of rendering middleware Before entering the world of OpenSceneGraph, we assume that you are already experienced in OpenGL programming You work with stacks of matrices, set pipeline states, look for new extensions,... widely applied in many modern software and applications, for instance, AutoCAD, Maya, CorelDraw, VRML, Open Inventor, and the one that we are going to investigate OpenSceneGraph [8] www.it-ebooks.info Chapter 1 The Birth and development of OSG The OpenSceneGraph project was initiated as an avocation by Don Burns in 1998 He used to work for SGI and is a hang-gliding enthusiast He wrote a simplified SGI Performer-like . 297 Creang 3D texts 30 0 Time for acon – creang texts in the world space 30 1 Creang parcle animaons 30 3 Time for acon – building a fountain in the scene 30 5 Creang shadows on the ground 31 0 www.it-ebooks.info . 231 Various events 232 Handling mouse and keyboard inputs 233 Time for acon – driving the Cessna 234 Adding customized events 239 Time for acon – creang a user mer 239 Picking objects 2 43 Intersecon. 29 Prebuilts making trouble? 30 Cross-plaorm building 31 Starng CMake 31 Time for acon – running CMake in GUI mode 32 Seng up opons 35 Generang packages using Visual Studio 37 Time for acon – building

Ngày đăng: 05/05/2014, 15:35

Từ khóa liên quan

Mục lục

  • Cover

  • Copyright

  • Credits

  • Foreword

  • About the Authors

  • About the Reviewers

  • Table of Contents

  • Preface

  • Chapter 1: The Journey into OpenSceneGraph

    • A quick overview of rendering middleware

    • Scene graphs

    • The Birth and development of OSG

    • Components

    • Why OSG?

    • Who uses OSG?

    • Have a quick taste

    • Time for action – say "Hello World" OSG style

    • Live in community

    • Summary

    • Chapter 2: Compilation and Installation of OpenSceneGraph

      • System requirements

      • Using the installer

Tài liệu cùng người dùng

Tài liệu liên quan