3D Graphics With XNA Game Studio 4.0

292 552 0
3D Graphics With XNA Game Studio 4.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

3D Graphics with XNA Game Studio 4.0 Create attractive 3D graphics and visuals in your XNA games Sean James BIRMINGHAM - MUMBAI D ownload from Wow! eBook <www.woweb o o k . c o m > 3D Graphics with XNA Game Studio 4.0 Copyright © 2010 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, 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 information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: December 2010 Production Reference: 1071210 Published by Packt Publishing Ltd. 32 Lincoln Road Olton Birmingham, B27 6PA, UK. ISBN 978-1-849690-04-1 www.packtpub.com Cover Image by Charwak A ( charwak86@gmail.com ) Credits Author Sean James Reviewers Zhenyu George Li Cătălin Zima-Zegreanu Acquisition Editor David Barnes Development Editor Tariq Rakhange Technical Editor Namita Sahni Copy Editor Laxmi Subramanian Indexers Monica Ajmera Mehta Rekha Nair Editorial Team Leader Aditya Belpathak Project Team Leader Ashwin Shetty Project Coordinator Poorvi Nair Proofreader Lynda Sliwoski Graphics Geetanjali Sawant Production Coordinator Shantanu Zagade Cover Work Shantanu Zagade About the Author Sean James is a computer science student who has been programming for many years. He started with web designing, learning HTML, PHP, JavaScript, and so on. Since then he has created many websites including his personal XNA and game development focused blog, www.innovativegames.net . In addition to web designing, he has interests in desktop software development and development for mobile devices such as Android, Windows Mobile, and Zune. However, his passion is for game development with DirectX, OpenGL, and XNA. Sean James lives in Claremont, CA with his family and two dogs. I would like to thank my family and friends who supported me throughout the writing of this book, and all the people at Packt Publishing who worked hard on the book to support me. I would also like to thank the XNA community for providing such amazing resources, without which this book would not have been possible. About the Reviewers Zhenyu George Li has been working as a software engineer in the game industry for more than ten years. In his early years, George really enjoyed playing video games and dreamed to be a game developer, so he started learning Turbo C 3D programming and DirectX6 in 1998. George's article series, The Road to Game Development – DirectX Programming with C++ Builder, was published in the magazine Computer Programming Techniques and Maintenance in China in 2000, and George won the magazine's Best Writer prize of the year. After moving to Canada in 2001, George has been working for some companies on several game titles and tools such as CT Baseball (Taiwan), The Bigs2, Dead Rising 2, online poker games, Heroes of Mythology, Battle of Britain, and Avatar XNA skinned Model Animation Engine. As a video game developer, George has accumulated ample knowledge and experience in computer graphics, game play, game frontend and UI, as well as game engine and tools development. The rst time George used Microsoft XNA in 2005, he realized that XNA had great potential for developers, educators, and learners because of its easy-to-learn programming language, C#, and multi-platform support. In 2007, George's book XNA PC and Xbox360 C# Game Programming was published in Taiwan and promoted by Microsoft Taiwan. George was also invited to translate the book Game Programming Gems 4 that was published in Taiwan in 2006. I am thankful to Pat McGee for helping me with the Avatar XNA Skinned Mesh Animation Engine project and referring the opportunity of being the technical reviewer of 3D Graphics with XNA Game Studio 4.0. I also want to appreciate Charles Yeh and Dr. Wyn Roberts' support on my works and publications. Cătălin Zima-Zegreanu has been coding games and graphics as a hobby for over eight years, and is planning on continuing to do so. Starting with Pascal, he continued with OpenGl and DirectX and is now passionately in love with XNA Game Studio. He got involved with XNA and its community since the rst beta version, released back in 2006, and likes to hang around the ofcial Creator's Club Forums, to chime in whenever he feels he can help someone. His activity as well as his articles and samples released for the growing community were rewarded with the Microsoft XNA/DirectX MVP Award. You can follow his activity on his own site ( http:// catalinzima.com ), as well as on "Sgt. Conker" ( http://sgtconker.com )—an XNA community site he's managing together with a group of "absolutely ne" men. I'd like to thank my wife for being a geek. Just like me! :) www.PacktPub.com Support files, eBooks, discount offers and more You might want to visit www.PacktPub.com for support les and downloads related to your book. Did you know that Packt offers eBook versions of every book published, with PDF and ePub les available? You can upgrade to the eBook version at www.PacktPub. com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at service@packtpub.com for more details. At www.PacktPub.com , you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks. http://PacktLib.PacktPub.com Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books. Why Subscribe? Fully searchable across every book published by Packt Copy and paste, print and bookmark content On demand and accessible via web browser Free Access for Packt account holders If you have an account with Packt at www.PacktPub.com , you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access . • • • Table of Contents Preface 1 Chapter 1: Getting Started with 3D 7 Setting up a new project 7 The 3D coordinate system 10 Matrices 10 Loading a model 12 Drawing a model 14 Creating a Custom Model class 18 Creating a Camera class 21 Creating a target camera 22 Upgrading the camera to a free camera 24 Calculating bounding spheres for models 27 View frustum culling 29 Additional camera types: Arc-Ball 31 Additional camera types: chase camera 34 Example—spaceship simulator 37 XNA Graphics Profiles 39 Summary 39 Chapter 2: Introduction to HLSL 41 Getting started 42 Assigning a shader to a model 44 Creating a simple effect 48 Texture mapping 52 Texture sampling 54 Diffuse colors 56 Ambient lighting 56 Lambertian directional lighting 57 Phong specular highlights 60 D own l o a d f r o m W o w ! e B o o k < w ww.woweb o o k . c o m > . December 201 0 Production Reference: 107 12 10 Published by Packt Publishing Ltd. 32 Lincoln Road Olton Birmingham, B27 6PA, UK. ISBN 978-1-8496 90- 04-1 www.packtpub.com. the finishing touches 200 Summary 203 Chapter 8: Advanced Materials and Post Processing 205 Advanced Materials 206 Post processing 208 Black and white post

Ngày đăng: 10/12/2013, 14:16

Từ khóa liên quan

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

Tài liệu liên quan