Quest to create a Hologram with a JPEG! (how to? using Thin Instances, Matrix, Arrays)

One of the major aims of Typescript is to check your code for errors before it is compiled into Javascript. Javascript does not do error checking anywhere near the level of Typescript.

Now Babylon.js is written in Typescript so when you write code in Typescript it uses the Typescript version of Babylon.js with all the inherent error checking.

The way StandardMaterial is set up in Typescript the function that creates is given two parameters (name, scene) and these are not set up to be optional as parameters - if scene was optional it would be (name, scene?)

That means that whenever you create a new standard material in Typescript you must give both parameters.

However when the scene was made an optional parameter this was done within the StandardMaterial function code itself (the only way you can do it for Javascript) if the code finds it is not present it then it knows to use the current scene.

Javascript deals with the missing parameter within the function code and and we all say scene is an optional parameter

Typescript says I was told two parameters and I only got one so I am not going any further deal with it.

2 Likes