Coins appear after scene loaded, and button is now blinking
This commit is contained in:
3
js/l3d/apps/prototype/Coin.js
vendored
3
js/l3d/apps/prototype/Coin.js
vendored
@@ -91,6 +91,8 @@ Coin.update = function() {
|
||||
|
||||
}
|
||||
|
||||
document.getElementById('next').style.background = instantToColor(Coin.colorInstant);
|
||||
|
||||
// Coin.domElement.width = Coin.domElement.width;
|
||||
|
||||
// Coin.ctx.drawImage(Coin.image, x + 75,25,30,30);
|
||||
@@ -289,6 +291,7 @@ Coin.init = function(scale) {
|
||||
function(object) {
|
||||
object.traverse(function (mesh) {
|
||||
if (mesh instanceof THREE.Mesh) {
|
||||
mesh.visible = false;
|
||||
mesh.scale.set(scale,scale,scale);
|
||||
mesh.material.color.setHex(0xff0000);
|
||||
mesh.geometry.computeVertexNormals();
|
||||
|
||||
12
js/l3d/apps/prototype/interactive/main.js
vendored
12
js/l3d/apps/prototype/interactive/main.js
vendored
@@ -1,6 +1,18 @@
|
||||
// Let's be sure we avoid using global variables
|
||||
var onWindowResize = (function() {
|
||||
|
||||
L3D.ProgressiveLoader.onFinished = function() {
|
||||
|
||||
if (coins.length === 0 || coins[0].mesh == undefined) {
|
||||
setTimeout(L3D.ProgressiveLoader.onFinished, 500);
|
||||
return;
|
||||
}
|
||||
|
||||
for (var i = 0; i < coins.length; i++) {
|
||||
coins[i].mesh.visible = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Disable scrolling
|
||||
window.onscroll = function () { window.scrollTo(0, 0); };
|
||||
|
||||
|
||||
@@ -130,6 +130,7 @@ TutorialSteps.prototype.setCameras = function(cameras) {
|
||||
|
||||
TutorialSteps.prototype.addCoin = function(coin) {
|
||||
this.coins.push(coin);
|
||||
coin.mesh.visible = true;
|
||||
coin.addToScene(this.scene);
|
||||
this.clickableObjects.push(coin);
|
||||
};
|
||||
|
||||
@@ -382,6 +382,11 @@ ProgressiveLoader.prototype.initIOCallbacks = function() {
|
||||
if (typeof self.log === 'function')
|
||||
self.log(self.numberOfFacesReceived, self.numberOfFaces);
|
||||
self.finished = true;
|
||||
|
||||
if (typeof L3D.ProgressiveLoader.onFinished === 'function') {
|
||||
L3D.ProgressiveLoader.onFinished();
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user