Render HTML page in scene

How to view html page in scene when clicking the button anybody knows help me…

Man! this is a bit too wide as a question

Here is a good guidance on how to get precise, fast and accurate answers:
Make the Best Use of the Forum | Babylon.js Documentation (babylonjs.com)

3 Likes

Actually it is the same like with usual HTML page.
Here is one of the examples (modal window when clicking on mesh) - Click on 3D Model Opens Modal Window with Specific WordPress Post – BabylonPress

2 Likes

Thanks @labris Is there any way to view html page inside 3D scene with layer or any meshes like applying textures.

Hi. Simple answer no you can’t. But you can use something like html2canvas and dynamic texture. Or better way use babylons 2d gui

In this case you may try CSS3DRenderer - Youtube videos on a mesh (port of CSS3DRenderer.js)

3 Likes

Thank you @labris I got some reference.

1 Like

I download the code from playground and run it locally in my machine. The output didn’t show anything it shows only white screen and the console error shows null id “canvasZone” . So I create div tag and give an id as “canvasZone” .Then the code runs didn’t shows any error but the output shows meshes (box and sphere) only not the webpage. what to do? Is it correct to create div tag to name the id?

This example uses div id from the PG.
To make it work t will be enought just to put the canvas inside the div with id=canvasZone.

It is correct.

webpage not showing. I did like this
canvas id=“renderCanvas”
div id=“canvasZone” /div
/canvas
Its not working.

<div id="canvasZone">
<canvas id="renderCanvas">
</canvas>
</div>
2 Likes

Its solved labris. I’m new to babylon and 3d environment .so I’m asking again and again plz don’t mind.

1 Like

Hello @labris , please i didnt find the solution to open a modal html inside babylonjs like the mentioned exemple : Click on 3D Model Opens Modal Window with Specific WordPress Post – BabylonPress

Any helps please ?

You can find it from line 254 (with some CSS above) in this example - Click on 3D Model Opens Modal Window with Specific WordPress Post – BabylonPress
Let me know if you’ll have some problems.

Thanks @labris , but where is the line 254 ? i cant find the playground for this exemple !?

You may find the line 254 in the source code of abovementioned example:


(the script ends at line 429).
If it is still compicated, let me know and I’ll prepare the separate HTML page with modal example.

1 Like

And here it is, the simple HTML example - Open HTML modal on mesh click