Babylonjs in ionic

hey there,
in case someone needs babylon.js in an app

I use this code:

$scope.canvasElement = angular.element(document.getElementById('renderCanvas'));
if (BABYLON.Engine.isSupported()) { 
  console.log("BABYLON.Engine.isSupported"); // shows up
  $scope.engine = new BABYLON.Engine($scope.canvasElement[0]); 
}

Bruce

1 Like

How to use importMesh, seems doesn’t find file.

code

BABYLON.SceneLoader.ImportMesh("", “resource/mesh/”, “skull.babylon”, scene, function (newMeshes) {
// Set the target of the camera to the first imported mesh
camera.target = newMeshes[0];
});

the file is under www/resource/mesh