Babylon js viewer config

Hello, i have several questions/problems

Is the babylon viewer still getting updates?
As it apears it seems to have a lot of problems (for me at least)
i have been trying to follow this but it has multiple problems

  1. Google chrome have a shadow/light problem where the model turns pitch black
  2. the render canvas have a size issue on all browsers where they no longer fill the full screen

i have been trying to make a viewer scene without the box that serounds the model but keep the toolbar in tact. And enable the vr option aswell. i have spend countless hours bu with no succsess unforuntate, so i was wondering if this was even still getting updated

The viewer is being updated with the latest babylon core version, and if there is any bug we fix it as soon as we can.

Do you want to share what you are trying to do? some code? we might be able to help further if we knew what the issues are.

i have tried starting out easy and tried following the link i provied
right now i’m just trying to config babylon viewer using javasript,

but somehow once i try do the same, the canvas somehow horizontally shrinks, this happens in all browsers, to make things worse, in Google chrome the boombox modle turns pitch black, above the problem i already have

the viewer is working and is being used in different websites already.
If you want to share your code it will be simpler to help.

like i mentiond i have just made a simple

<babylon id="babylon-viewer" model="https://models.babylonjs.com/boombox.glb"></babylon>

and just took the javascript from this link

We’ll eventually get to a point where we can help :slight_smile:

Doing that should work. If that doesn’t work (without javascript), then something is wrong in the setup, or the viewer is totally not functional. But it does - BabylonJS Viewer - Basic usage.

Now - what are you doing in javascript, what is not working, do you have any errors in the console? What do you mean that the object turns dark? Have you configured the canvas’s size using css? Are you running this code:

let domElement = document.getElementById('my-amazing-element');

let viewer = new BabylonViewer.DefaultViewer(domElement, {
    scene: {
        debug: true
    },
    camera: {
        behaviors: {
            autoRotate: 0
        }
    },
    model: {
        url: "https://playground.babylonjs.com/scenes/Rabbit.babylon"
    }
});

? different code?

Telling us “the viewer doesn’t work” leaves us with little details to work with. telling us the model turns dark doesn’t let us understand what actually happens. Screenshots, code examples, non-working demos.

in that case i apoligize

i posted a screenshot where the with somehow shrinks once i try use a config using javascript

the same result but the model turns pitch black if google chrome is used

and if you want the full html

<html>
<head>
  <title>View 3D models on the web and in mixed reality</title>
  <link rel="stylesheet" href="style.css">
</head> 
<body>
    <babylon id="babylon-viewer" model="https://models.babylonjs.com/boombox.glb"></babylon>
    <script src="https://preview.babylonjs.com/viewer/babylon.viewer.js"></script>
    <script src="./index.js"></script>
  </body>
</html>

Did you try in your environment any of examples from this page? - Babylon.js Viewer Examples | Babylon.js Documentation

yes, they dont have give the problems i have, but i’m trying to avoid dom configuration,
as 1 i dont like it,2 it gets unreadeble fast, 3 i’m trying for 1 global config

i’m trying to make a javascript config that’s basicly the same as the default setup, but without the cube around the model, and Vr enabled

Here is a pen - [Babylon.js Viewer] Display a 3D model (codepen.io)

skybox is set to false, fullscreen mode

i took a look at the codepen you made and tried it,
but the page is somehow hust white, there’s nothing
no errors in the log, no vissible content

the log says: Babylon.js viewer (v5.0.0-alpha.24)

i’m also using vscode live server plugin, maybe that is usefull to know but should have no problems
running in firefox

also have i tried downloading the model loccally and use that instead no chance
the default scene loads but no model

Check your network tab and make sure the model loaded. Also try not to use the babylon tag, but use a different tag (div?) just to be sure the browser is not trying to initialize the viewer

There is no magic done in this code pen… if it works in codepen, it should work locally

1 Like

yes after chancing it to a div and moving both script tags to the bottom of the page worked,
also thank you for the skybox tip

oh btw: is there perhaps also a way to remove the babylon button ?
i know how to add buttons to the toolbar, but not remove them

Sure, set the navBar’s hideLogo to true.

it seems i have some more trouble with the config i made a copy of your repo and tried enable Vr there aswell, but it seems not to be working im i missing something ?

Params were in the wrong place -

[Babylon.js Viewer] Display a 3D model (codepen.io)

1 Like

ah thank you once again, but i’l have to question some more.
because i dont understand yet why turning the vr button on doesn’t make the Vr work?
clicking the button does not start Vr