Forum

add iframe inside a cube

10 May 2017 12:21
Hi,

Is it possible to embed one iframe into a cube? The iframe will show an external web page data/charts.

So in one side of the cube - it will show some charts which will be dynamically changing
11 May 2017 11:57
I think what you are talking about is using HTML elements to texture a 3D object. I think the closest you will come to that is custom anchors which give you the ability to apply customized HTML tags to objects but they are not applied as textures.
Ian has a great video on this: https://www.youtube.com/watch?v=GtrsMEh5VNI
11 May 2017 11:58
Hi,

Is it possible to embed one iframe into a cube? The iframe will show an external web page data/charts.

So in one side of the cube - it will show some charts which will be dynamically changing
Hi and welcome to our forum!

There is no embedded mechanism in the engine to solve your task. But it can be done via CSS3D scripting.

I've found an old demo suitable for your purposes. You need to import it with Project Manager. It will create a project folder blend4web/apps_dev/html3d

I would suggest to pay attention to several points in the following files:

1. html3d.html
- Add iframe/another html element you want to have in 3D

2. html3d.js
- SIZE_MULT variable.
You can use it to change pixel size in virtual space
1 pixel of html element = 1 virtual cm by default.
- load_cb function.
Here we attach the HTML element to the "Plane" object.
Blend4Web Team - developer
Twitter
LinkedIn
11 May 2017 14:16
Thanks a lot @Konstantin Khomyakov.

I am trying with your code and will let you know if I need more help
24 May 2017 11:57
Hi @Konstantin Khomyakov,

your version of code does not work with the latest version of blend4web.js. Can you help me to update it?
29 May 2017 12:06
Hi @Konstantin Khomyakov,

your version of code does not work with the latest version of blend4web.js. Can you help me to update it?
Hi,

it should work fine. What is the problem?
Blend4Web Team - developer
Twitter
LinkedIn
02 June 2017 10:07
When I am taking the latest version of b4w.min.js , it's throwing error - Wrong object name

and if i try to load the json to a new version - its throwing error - the json is too old to be used with the new version.
06 June 2017 16:41
When I am taking the latest version of b4w.min.js , it's throwing error - Wrong object name

and if i try to load the json to a new version - its throwing error - the json is too old to be used with the new version.
It is strange. It works fine for me with 17.04.1 version of the b4w engine without any tweaking.

To remove "Wrong object name" error you can remove/comment this line from html3d.js:
container.addEventListener("mousedown", obj_inform, false);
Blend4Web Team - developer
Twitter
LinkedIn
07 June 2017 09:30
can you please send me the zip for the new version ?
07 June 2017 09:31
I can't get any web page to be embedded on the cube…
 
Please register or log in to leave a reply.