Semi-Succesful I-frame url inside blend 4 web

03 February 2016 02:00
Hey i have linked css3drenderer.js and t-query-bundle.js and have successfully added an iframe inside my blend 4 web json file with the following code inside the canvas divider

	var world	= tQuery.createWorld().boilerplate().start();
			// .wireframe(true)
			// .wireframeLinewidth(3)
	var rendererCSS	= new THREE.CSS3DRenderer();
	rendererCSS.setSize( window.innerWidth, window.innerHeight );	= 'relative';	= 0;	= 0;	= 0;
	document.body.appendChild( rendererCSS.domElement );


	// put the mainRenderer on top
	var rendererMain	= world.tRenderer();	= 'relative';	= 0;	= 1;
	rendererCSS.domElement.appendChild( rendererMain.domElement );

	var element	= document.createElement('iframe')
	element.src	= '' = '1024px'; = '1024px';

	// var element = document.createElement( 'div' );
	// = '100px';
	// = '100px';
	// = new THREE.Color( Math.random() * 0xffffff ).getStyle();

	var sceneCSS	= new THREE.Scene();
	var objectCSS 	= new THREE.CSS3DObject( element );
window.objectCSS	= objectCSS
	sceneCSS.add( objectCSS );

	world.loop().hookPostRender(function(delta, now){
		rendererCSS.render( sceneCSS, world.tCamera() );

It really is just like an extra layer of webgl in the canvas with a transparent back ground but if i find a way to disconnect the camera controls and fix it in position some where in the code (late right now) while i wander in blend 4 web scene it is a temporary solution for someone.

Original demonstration of the website inside webgl -
03 February 2016 11:01
Thanks for the info! This technique has some drawbacks but we'll take a look on this.
03 February 2016 12:48
** UPDATE **

From further investigation it seems the camera transform needs to be in sync with the users input in the tquery which seems dumb to do, but since it is using a lambert material there might be a way to assign an object the material and just hide the extra layer getting the material for now.

In any case if anyone is going to go forward with trying to embed an iframe with the css3drenderer and tquery here are two lines of code to note.

//make links in web pages clickable by setting z-index to negative -1 = -1;

//remove camera control to fix the iframe in place

I might try to sync the camera translation to the b4w input and i will try to see if i can assign the material to a plane. Im pretty noob but ill give it a stab.

03 February 2016 19:28
Looking at the webgl inspector all vertex and fragment shaders have nothing to do with the iframe material.. I looked at voodoo.js mixing webgl with html but that got discontinued it seems… Anyway ill update this post if i have make any progress in making a iframe plane fixed inside of blend 4 web scene.
04 February 2016 00:43
Ok i think this is the solution!

I also found

But i just have no clue whats going on However I did notice there was a webgl conference couple years ago about rendering html dom subtree as a texture

I hope this helps out a bit. I also looked into voodoo.js which seemed to be able to mix webgl and html perfectly but there discontinued and website is offline.
Please register or log in to leave a reply.