cjcliffe/CubicVR.js — Issue #56: Crashy double-canvas action
Author: secretrobotron
Created: 2011-12-14 02:22:09+00:00
State: open

This bit of code breaks CubicVR all over and smashes Firefox in the face. Like violent joint-aches on a rainy day.

```
function Scene( canvas ) {
var gl = CubicVR.init( canvas ),
boxMesh = new CubicVR.Mesh({
primitive: {
type: "box",
size: 1.0,
material: {
textures: {
color: "../images/6583-diffuse.jpg"
}
},
uv: {
projectionMode: "cubic",
scale: [1, 1, 1]
}
},
compile: true
}),
boxObj = new CubicVR.SceneObject( boxMesh ),
scene = new CubicVR.Scene( canvas.width, canvas.height, 60 ),
ml = new CubicVR.MainLoop( function( timer, gl ) {
scene.render();
});

scene.bind(boxObj);
scene.camera.position = [1, 1, 1];
scene.camera.target = [0, 0, 0];
CubicVR.addResizeable(scene);
var mvc = new CubicVR.MouseViewController( canvas, scene.camera );

} //Scene

var scene1 = new Scene( document.getElementById( "canvas1" ) ),
scene2 = new Scene( document.getElementById( "canvas2" ) );
```
The problem occurs almost right away, initializing `boxMesh`. I'm going to take a stab at guessing what the problem might be: buffer compiling?