Sign in to follow this  
falsam

Insert Babylonjs in the DOM with require.js

Recommended Posts

I use a web  programming language based on the Basic syntax. i know, it's stange. :ph34r:

The main purpose of this language is to allow development  windowed based web applications . It provides  commandset to handle GUI and 2D games.

The compiler generates html and  JavaScript files or packages for Android ans iOS

This programming language uses the Dojo.js and Pixi.js frameworks.

But  ... no features for 3D environment.

I have created a plugin that integrates the minimal features of babylonjs.

Example : Mesh = CreateBox(Name.s, Width.f, Height.f, Length.f)

I insert babylonjs in my plugin like this :

require( [ bjsenginepath + "/babylon.custom.js" ], ..

I have no probleme with the 3.1 version. But i have errors with the 3.2 Alpha.  

Quote

Uncaught TypeError: Object prototype may only be an Object or null: undefined
    at setPrototypeOf (<anonymous>)
    at __extends (babylon32.custom.js:1)
    at babylon32.custom.js:13755
    at BABYLON (babylon32.custom.js:13755)
    at babylon32.custom.js:13755

Thank you for your help.

 

Share this post


Link to post
Share on other sites
4 hours ago, Deltakosh said:

Can you share a page using 3.2?

Ooops sorry. I should have done it in my first message. 

First test.
Custom version 3.1.1(Cannon.js,  GUIObjSkyMaterialWater material) that I currently use. It's working.
http://falsam.com/sbbjs/basicscene.html

Second test.
CDN version 3.1.1 Version CDN 3.1.1. It's working. 
http://falsam.com/sbbjs/basicscene31CDN.html

Third test:
Custom version 3.2.0 AlphaB that generates the errors I copied in the previous comment. 
http://falsam.com/sbbjs/basicscene32.html

And finally this fourth test :
Version CDB 3.2.0 AlphaB that generates this error.
http://falsam.com/sbbjs/basicscene32CDN.html

Quote

Uncaught ReferenceError: BABYLON is not defined

Tested with Chrome and Edge

 

Share this post


Link to post
Share on other sites

My problem is solved. 

I use the required function to load the babylon.js script.

With previous releases of babylon I did like this

require(["https://cdnjs.cloudflare.com/ajax/libs/babylonjs/3.0.0-alpha/babylon.js"]

  With the new version

require(["babylonjs", "https://cdnjs.cloudflare.com/ajax/libs/babylonjs/3.2.0/babylon.js"

Thanks for this excellent framework

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.