I had learned to code babylonjs scenes in type script
import {Scene, Engine, FreeCamera, Vector3, HemisphericLight, MeshBuilder, StandardMaterial, Texture, CubeTexture, PBRMaterial, SceneLoader, AbstractMesh, ActionManager, SetValueAction, InterpolateValueAction, IncrementValueAction, Mesh, CannonJSPlugin, PhysicsImpostor, Size, Color3, int} from "@babylonjs/core"
import "@babylonjs/loaders"
import * as CANNON from "cannon"
export class FpController {
scene: Scene
engine: Engine
box!: AbstractMesh
sphere!:AbstractMesh
cylinder!:AbstractMesh
ground!:AbstractMesh
sphereMat!: PBRMaterial
x: int
constructor( private canvas:HTMLCanvasElement){
this.x = Math.floor( Math.random() * 2) +1;
this.engine =new Engine(this.canvas, true)
this.scene = this.CreateScene()
if (this.x === 2){
this.CreateEnvironment()
}
if (this.x === 1){
this.CreateEnvironment2()
}
// this.CreateImposter()
this.CreateController()
// this.Triggered()
this.engine.runRenderLoop(()=>{
this.scene.render()
})
}
and as of now I am trying to launch it as a website. I have tried github, "npm run build" and "Netlify", none of them have worked. Does anyone know what to do?
As of now I am trying to launch it as a website. I have tried github, "npm run build" and "Netlify", none of them have worked. Does anyone know what to do?