Crafting a PG Snippet
Before we can use our PG code in our application, we’re going to need to do some light refactoring. A little bit of preparation can save a lot of time later! The things we’re going to change are select pieces of code that could vary between the PG and local environments, such as texture paths and URLs, along with some minor structural modifications. For your convenience, here’s a link to the refactored snippet. If you are just joining us here in the journey, use the link below. If you’ve been following along, substitute your own snippet URL for the following one. Start by opening your favorite browser and navigating to either your own snippet or to https://playground.babylonjs.com/#0UYAPE#42.
Cleaning up the BABYLON Namespace Prefix
One of the things that you may have found annoying about coding in the PG is how in the PG it’s necessary to always prefix BJS types with the BABYLON
namespace. This is not ideal, but we can...