mrdoob/three.js — Issue #1389: CanvasRenderer on a canvas doesn't work in Firefox but does work on IE and Chrome
Author: alanwol
Created: 2012-02-24 12:06:28+00:00
State: open

The following line appears not to work in firefox:

renderer = new THREE.CanvasRenderer( { canvas: myCanvas} );

How can I fix this? I'm I doing something wrong or is it a firefox problem? I can supply the complete page but don't know how to do it correctly.

Relevant code parts

In the javascript:

Init() function:

container = document.getElementById('divcan');

// This does not work in firefox but works in ie and chrome
renderer = new THREE.CanvasRenderer( { canvas: myCanvas} );

// This works in firefox, ie and chrome
//renderer = new THREE.CanvasRenderer();

renderer.setSize( 640, 480 );
container.appendChild( renderer.domElement );
//document.body.appendChild( renderer.domElement );

stats = new Stats();
stats.domElement.style.position = 'absolute';
stats.domElement.style.top = '0px';
container.appendChild( stats.domElement );