Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Going the Distance with Babylon.js

You're reading from   Going the Distance with Babylon.js Building extensible, maintainable, and attractive browser-based interactive applications using JavaScript

Arrow left icon
Product type Paperback
Published in Sep 2022
Publisher Packt
ISBN-13 9781801076586
Length 426 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Josh Elster Josh Elster
Author Profile Icon Josh Elster
Josh Elster
Arrow right icon
View More author details
Toc

Table of Contents (20) Chapters Close

Preface 1. Part 1: Building the Application
2. Chapter 1: The Space-Truckers Operation Manual FREE CHAPTER 3. Chapter 2: Ramping up on Babylon.js 4. Chapter 3: Establishing the Development Workflow 5. Chapter 4: Creating the Application 6. Chapter 5: Adding a Cut Scene and Handling Input 7. Part 2: Constructing the Game
8. Chapter 6: Implementing the Game Mechanics 9. Chapter 7: Processing Route Data 10. Chapter 8: Building the Driving Game 11. Chapter 9: Calculating and Displaying Scoring Results 12. Chapter 10: Improving the Environment with Lighting and Materials 13. Part 3: Going the Distance
14. Chapter 11: Scratching the Surface of Shaders 15. Chapter 12: Measuring and Optimizing Performance 16. Chapter 13: Converting the Application to a PWA 17. Chapter 14: Extended Topics, Extended 18. Index 19. Other Books You May Enjoy

Making the Mini-Map

While the bulk of the next chapter will focus on the Babylon.js GUI, we’ll dip our feet into the waters of the topic of User Interfaces (UIs) as we take a moment to discuss coordinate systems and polar coordinates. First, though, let’s look at how we get to the point where talk of coordinate systems becomes necessary by examining the initializeGui method of our Playground.

Note

In the application, this logic is contained in the driving-gui.js module in /src/driving/. Aside from moving the code to load the Node Material into it, the code is identical to the Playground.

At the beginning of this chapter, we talked about Viewports in the Initializing the Driving Phase Scene section, and we described two main characteristics – the viewport’s size and position. For the main Scene camera, the Viewport stretches the full size of the screen, but for our GUI system, the Viewport is defined differently.

The GUI Camera

The initializeGui...

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
Banner background image