Jump to content

Odd problem with bGUI, showing tiny model


Recommended Posts

When I use bGUI at all, even just this line:

var gui = new bGUI.GUISystem(scene, 1024, 768);

It creates a tiny version of my scene on top of the current scene.  In the attached image you can see that in debug mode it is showing the tiny bounding box that is the main model in my scene.  It is always on top of the bigger model and looks pretty bad.  Any way to hide this?


Link to comment
Share on other sites

  • 10 months later...

I'm having the same problem.

window.addEventListener("DOMContentLoaded", function() {
    var canvas          = document.getElementById("renderCanvas");
    var engine          = new BABYLON.Engine(canvas, true);
    var scene           = new BABYLON.Scene(engine);
    var assets = [];

    var loader = new BABYLON.AssetsManager(scene);

    var toLoad = [
        {name : "button", src : "assets/button.png" }

    toLoad.forEach(function(obj) {
        var img = loader.addTextureTask(obj.name, obj.src);
        img.onSuccess = function(t) {
            assets[t.name] = t.texture;

    loader.onFinish = function() {

        init3d(scene, canvas);
        var gui;
        setTimeout(function() {
            /* GUI CREATION when all texture are loaded*/
            gui = new bGUI.GUISystem(scene, engine.getRenderWidth(), engine.getRenderHeight());

            // button
            /*var button = new bGUI.GUIPanel("button", assets["button"], null, gui);
            button.relativePosition(new BABYLON.Vector3(0.05, 0.9, 0));
            button.onClick = function() {

            gui.updateCamera();}, 10);
        engine.runRenderLoop(function() {



function init3d (scene, canvas) {
    var camera = new BABYLON.ArcRotateCamera("Camera", 0, 0, 10, BABYLON.Vector3.Zero(), scene);
    var light = new BABYLON.PointLight("Omni0", new BABYLON.Vector3(-17.6, 18.8, -49.9), scene);
    camera.setPosition(new BABYLON.Vector3(-15, 3, 0));
    camera.attachControl(canvas, true);

    // Skybox
    var skybox = BABYLON.Mesh.CreateBox("skyBox", 100.0, scene);
    var skyboxMaterial = new BABYLON.StandardMaterial("skyBox", scene);
    skyboxMaterial.backFaceCulling = false;
    skyboxMaterial.reflectionTexture = new BABYLON.CubeTexture("babylon/assets/textures/skybox/TropicalSunnyDay", scene);
    skyboxMaterial.reflectionTexture.coordinatesMode = BABYLON.Texture.SKYBOX_MODE;
    skyboxMaterial.diffuseColor = new BABYLON.Color3(0, 0, 0);
    skyboxMaterial.specularColor = new BABYLON.Color3(0, 0, 0);
    skybox.material = skyboxMaterial;

    // Landscape
    BABYLON.SceneLoader.ImportMesh("Grid", "scenes/", "landscape6.babylon", scene, function (newMeshes) {});
    var sphere = new BABYLON.Mesh.CreateSphere("sphere1", 32, 3, scene);

/*function animate (mesh, fps) {
    BABYLON.Animation.CreateAndStartAnimation("", mesh, "rotation.z", 60, fps, mesh.rotation.z, mesh.rotation.z + Math.PI *2, BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT);

You'll notice I basically copied the whole demo, just added my own mesh instead of the spheres. I did use updateCamera() within the setTimeout function as well as outside the whole onFinish block.


EDIT: Tried with the BabylonJS/assets/meshes/Dude/dude.babylon mesh, does the same thing.


Edited by Charapagna
Tried another imported mesh, thought the problem lied with my mesh.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...