Babylon.js Essentials - Julien Moreau-Mathis - E-Book

Babylon.js Essentials E-Book

Julien Moreau-Mathis

0,0
26,39 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

Understand, train, and be ready to develop 3D Web applications/video games using the Babylon.js framework, even for beginners

About This Book

  • Understand the basics of 3D (along with the theory) before practicing
  • Each mini-project provides previous features, alongside the new feature you are learning, to supply the examples
  • Learn from the best of the best, a developer at Microsoft, France

Who This Book Is For

Babylon.JS Essentials is intended for developers who want to enter the world of 3D development for the Web, or developers who want to add the Babylon.js framework to their skill set. The notion of Oriented Object Programming would be helpful to understand the architecture of the Babylon.js framework. Also, a familiarity with Web development would be useful, to understand the principles used.

What You Will Learn

  • Understand what the TypeScript language is and its benefits (compared to JavaScript) in large projects such as 3D engines
  • Learn the basics of 3D using Babylon.js without too much theory but with an emphasis on practice, for a better understanding of the architecture
  • Know the usage of Material—a fundamental principle of 3D engines in Babylon.js—and then customize the appearance of 3D objects
  • Integrate collisions and physics in gameplay. Understand the notion of impostor for physics simulation
  • Manage, create, and spatialize audio tracks in 3D scenes
  • Go further with the Babylon.js framework to create actions on events
  • Create rendering effects provided by the Babylon.js framework, such as post-processes

In Detail

Are you familiar with HTML5? Do you want to build exciting games and Web applications? Then explore the exciting world of game and Web development with one of the best frameworks out there: Babylon.JS.

Starting from the beginning, the book introduces the required basics for 3D development and the knowledge you need to use the Babylon.js framework. It focuses on the simplicity provided by Babylon.js and uses a combination of theory and practice. All the chapters are provided with example files ready to run; each example file provides the previously learned features of the framework. Finally, developers will be ready to easily understand new features added to the framework in the future.

Style and approach

The book is a comprehensive guide packed with ready-to-run examples with a mix of theory and practice.

Sie lesen das E-Book in den Legimi-Apps auf:

Android
iOS
von Legimi
zertifizierten E-Readern

Seitenzahl: 134

Veröffentlichungsjahr: 2016

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Table of Contents

Babylon.js Essentials
Credits
About the Author
About the Reviewer
www.PacktPub.com
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Babylon.js and the TypeScript Language
The creators
Online tools provided by the Babylon.js solution
Why is Babylon.js developed using TypeScript?
The TypeScript language
The TypeScript features
Introduction to TypeScript - what you have to know
Compilation using Gulp
Working with typed variables
Enumerated types
Array
Working with classes and interfaces
Creating a class
Creating class members
Working with inheritance
Using interfaces
Summary
2. The Fundamentals of Babylon.js and Available Tools
The Babylon.js structure and graphs
The engine and a scene
Adding cameras and lights
Adding a camera
Adding a light
Adding a mesh
Using Babylon.js to create meshes
Some other basic meshes
Managing a scene graph
An example
Creating your first scene
Creating a class and the scene nodes
Call the runRenderLoop method
Managing the scene graph
Summary
3. Create, Load, and Draw 3D Objects on the Screen
Using Blender to export scenes
Setting up the Babylon.js exporter for Blender
Activating the Babylon.js exporter in Blender
Exporting a scene
Using 3ds Max to export scenes
Installing the Babylon.js exporter for 3ds Max
Modifying the properties
Exporting the scenes
Loading scenes with Babylon.js programmatically
The BABYLON.SceneLoader class
The callbacks
Load and append
Importing a mesh
Summary
4. Using Materials to Customize 3D Objects Appearance
Discussing the awesome theory behind the materials
The theory
The vertex shader
The pixel shader
Using the Babylon.js standard material
The standard material and its common properties
Using the fog
Using textures with materials
Load and apply a texture
The bump mapping
Advanced texturing
The cube texture
The mirror texture
Summary
5. Create Collisions on Objects
Checking collisions in a scene
How collisions work in Babylon.js?
Configuring collisions in a scene
Configure gravity and ellipsoid
Simulate physics
Enable physics in Babylon.js
Impostors
Applying a force to a mesh
Configuring in Blender and 3ds Max
Collisions in Blender
Configuring physics simulations in Blender
Configuring collisions in 3ds Max
Configuring physics simulations in 3ds Max
Summary
6. Manage Audio in Babylon.js
Playing 2D sounds
Creating 2D sounds
Managing 2D sounds
Playing 3D sounds
Creating 3D sounds
Managing 3D sounds
Creating a directional spatialized sound
Summary
7. Defining Actions on Objects
Defining actions on objects
Enable actions on an object
Chain actions on an object
The available actions
Using conditions to control the actions graphs
State condition
Predicate condition
Value condition
Using the Actions Builder in 3ds Max
How it works
Managing multiple pipelines
Summary
8. Add Rendering Effects Using Built-in Post-processes
Using post-processes with Babylon.js
Starting with your first post-process
Chaining post-processes
Removing and retrieving post-processes
Using post-process rendering pipelines with Babylon.js
Create a rendering pipeline
Enabling and disabling effects in pipeline
The built-in post-processes
Volumetric Light Scattering post-process
SSAO rendering pipeline
HDR rendering pipeline
Summary
9. Create and Play Animations
Creating animations using Babylon.js
Animating an object with code
Using the animation manager of Babylon.js
Create a simple animation
Managing events
Using easing functions to smooth animations
Applying an easing function to an animation
Creating your own easing function
Importing and managing animated models
How 3D animated models work
Importing and playing animations of an animated 3D model
Summary

Babylon.js Essentials

Babylon.js Essentials

Copyright © 2016 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.

Publishing Month: February 2016

Production reference: 1230216

Published by Packt Publishing Ltd.

Livery Place

35 Livery Street

Birmingham 

B3 2PB, UK.

ISBN 978-1-78588-479-5

www.packtpub.com

Credits

Authors

Julien Moreau-Mathis

Copy Editors

Vibha Shukla

Reviewer

Sergio Martínez-Losa del Rincón

Project Coordinator

Bijal Patel

Commissioning Editor

Dipika Gaonkar

Proofreader

Safis Editing

Acquisition Editor

Larissa Pinto

Meeta Rajani

Indexer

Mariammal Chettiyar

Content Development Editor

Prashanth G Rao

Graphics

Disha Haria

Technical Editor

Bharat Patil

Production Coordinator

Conidon Miranda

About the Author

Julien Moreau-Mathis is a fan of 3D development. He started working with 3D development at the age of 17 and created a C++ framework named Community Play 3D. Now, he is a developer at Microsoft and he takes immense pleasure in being a part of the Babylon.js team.

About the Reviewer

Sergio Martínez-Losa del Rincón lives in Spain. He is a software engineer and entrepreneur.

He has always enjoyed writing technical documents as well as programming in several languages. He is always keen on learning new programming languages and facing new challenges. He has been creating applications and games for iPhone, Macintosh, Android, Google Glass, Unity3D, and Cocos2d-x. Sergio likes VR technologies and all kinds of challenges. He also likes web programming and designing good APIs for mobile applications.

So far, Sergio has developed all kinds of applications in Java, C++, Objective-C, PHP, and various other languages. He is now developing products in the IoT field using SaaS technologies. Sergio likes to explore cloud services in order to expand the application possibilities, he also likes machine learning technologies and natural language processing to study new ways of using big data.

You can see a part of his work here at http://goo.gl/k5tOSX.

www.PacktPub.com

For support files and downloads related to your book, please visit www.PacktPub.com.

Did you know that Packt offers eBook versions of every book published, with PDF and ePub files 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 <[email protected]> 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.

https://www2.packtpub.com/books/subscription/packtlib

Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can search, access, and read Packt's entire library of books.

Why subscribe?

Fully searchable across every book published by PacktCopy and paste, print, and bookmark contentOn demand and accessible via a 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 9 entirely free books. Simply use your login credentials for immediate access.

Preface

3D development has always been something mystic. Starting from the beginning, this book introduces the required basics of 3D development and the knowledge you require to use the Babylon.js framework. It focuses on the simplicity provided by Babylon.js and uses a combination of theory and practice. All the chapters are provided with example files that are ready to run; each example file provides the previously learned features of the framework. Finally, the developers will be ready to easily understand the new features that are added to the framework in the future and use the more advanced features only using the documentation.

What this book covers

Chapter 1, Babylon.js and the TypeScript Language, provides a quick introduction to the Babylon.js story and a course on a fundamental that is the TypeScript language.

Chapter 2, The Fundamentals of Babylon.js and Available Tools, starts with the Babylon.js framework and creates the first 3D scene, showing the simplicity of the framework along with the theory.

Chapter 3, Create, Load, and Draw 3D Objects on the Screen, starts with the concepts of Chapter 2, The Fundamentals of Babylon.js and Available Tools, let's introduce the right way to create 3D scenes and work with 3D artists.

Chapter 4, Using Materials to Customize 3D Objects Appearance, explains the notion of materials in 3D engines. In other words, let's unleash the Babylon.js Standard Material.

Chapter 5, Create Collisions on Objects, focuses on the gameplay itself by managing the collisions in your scenes, including physics simulation.

Chapter 6, Manage Audio in Babylon.js, explains one of the added values of the Babylon.js framework. Let's add and manage sounds, including spatialized sounds, in your scenes.

Chapter 7, Defining Actions on Objects, introduces a smart way to trigger actions on the 3D objects themselves without to many lines of code as some tasks can be a pain for developers.

Chapter 8, Add Rendering Effects Using Built-in Post-processes, shows the preferred part of most of the 3D developers. This shows and explains how to easily beautify the 3D scenes using post-processes effects, combined with the simplicity provided by Babylon.js.

Chapter 9, Create and Play Animations, allows us to play with the animations system provided by Babylon.js. This chapter provides the final skill that you need in order to be ready to build your own professional 3D application!

What you need for this book

This book targets HTML5 developers, who want to build complete 3D video games or applications on browsers. The reader should have some familiarity with the JavaScript language and basic 3D representations (notion of vectors and dimensions). The Babylon.js framework is designed to be easy to use, therefore, no 3D development background is needed and beginners are welcome.

Who this book is for

Babylon.js Essentials is intended for developers, who want to enter the world of 3D development for the Web or add the Babylon.js framework to their skill set. The notion of object-oriented programming would be helpful to understand the architecture of the Babylon.js framework. Also, familiarity with Web development would be useful to understand the principles used.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book-what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail <[email protected]>, and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at http://www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files from your account at http://www.packtpub.com for all the Packt Publishing books you have purchased. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Downloading the color images of this book

We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from https://www.packtpub.com/sites/default/files/downloads/BabylonJSEssentials_ColorImages.pdf.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books-maybe a mistake in the text or the code-we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at <[email protected]> with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at <[email protected]>, and we will do our best to address the problem.

Chapter 1. Babylon.js and the TypeScript Language

Babylon.js is a framework that allows you to create complete 3D applications and 3D video games for the Web. Babylon.js has a community that grows day after day; a community that actively contributes to the project, adding more and more features. This chapter gives you a brief introduction to the framework's vision and the TypeScript language as, Babylon.js was developed using this.

The Babylon.js framework embeds all the necessary tools to handle specific 3D applications. It allows you to load and draw 3D objects, manage these 3D objects, create and manage special effects, play and manage spatialized sounds, create gameplays, and more. Babylon.js is an easy-to-use framework as you can set up (you'll see this later) these things with the minimum lines of code.

Babylon.js is a JavaScript framework developed using TypeScript. TypeScript is a compiled and multiplatform language that generates pure JavaScript files.

We will cover the following topics in this chapter:

An introduction to Babylon.jsThe reason Babylon.js has been developed using TypeScriptAn introduction to TypeScript

The creators

Babylon.js was created by David Catuhe (@deltakosh), David Rousset (@davrous), Pierre Lagarde (@pierlag), and Michel Rousseau (@rousseau_michel). It's an open source project essentially developed in their spare time. When they started Babylon.js, they wanted it to be designed as easy-to-use and then get an accessible 3D engine for everyone. The official web site (http://www.babylonjs.com/) contains a lot of tutorials for beginners (even in 3D) to more advanced users with examples for each feature and scenes as examples.

Online tools provided by the Babylon.js solution