Katzumi Katzumi - 1 year ago 140
Javascript Question

Three.js as background of website possible?

I've been looking at using three.js for a fun experiment on a site. I would like to use a current experiment (for which I already have the code for) and use it as a background for my site.

Anybody know how to do this?

I saw it done here: http://janjorissen.be/

Three JS API: https://github.com/mrdoob/three.js/wiki/API-Reference

Answer Source

usually i use iframe for that. Thus you dont have conflict with the base page.

iframe {
    z-index : -9999;
    position: absolute;
    top : 0;
    left    : 0;
    width   : 100%;
    height  : 100%;
    margin  : 0;
    padding : 0;
<iframe src="http://example.com/"></iframe> 

an example of it https://github.com/jeromeetienne/www.jetienne.com/blob/master/index-webgl.html#L128 for the source http://jetienne.com/index-webgl.html for the living code

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download