Currently, I am utilizing three.js revision 53.
While attempting to load a texture in Canvas Renderer (specifically on Win7) and incorporating a callback for the onLoad event, the texture fails to display. Surprisingly enough, removing the callback function allows the texture to be displayed as intended:
// The following code does not work when adding a callback
var material = new THREE.MeshBasicMaterial({
map: THREE.ImageUtils.loadTexture('text_build.png', {}, function()
{
//do something
})
});
var plane = new THREE.Mesh(new THREE.PlaneGeometry(135, 135), material);
plane .overdraw = true;
scene.add(plane );
// However, without the callback, the following code works perfectly fine
var material = new THREE.MeshBasicMaterial({
map: THREE.ImageUtils.loadTexture('text_build.png')
});
var plane = new THREE.Mesh(new THREE.PlaneGeometry(135, 135), material);
plane .overdraw = true;
scene.add(plane );
Interestingly, when executing this same code in WebGL Renderer (on FF, Chrome on Win7), both examples work seamlessly.
If anyone could kindly point out any mistakes that I may have overlooked, it would be greatly appreciated.
Thank you very much.