问题
three.js r114
What happens is that I want to create a playfield field for field. When a button is pressed, a new playfield shall be created. That works.
Before the new playfield is created, the old one has to be deleted. Then the new playfield shall be created with a little delay after every single part of the field.
I tried a lot to make every change directly visible but there are no changes visible while the program is running.
First I try to make the playfield- object3d invisible so I call the method to do so. The field stays visible.
sample code:
function make_invisible(){
playfield.visible = false;
}
make_invisible();
The field stays visible.
If I return directly after calling that method so my program ends/ class is left, I can see the playfield.
function make_invisible(){
playfield.visible = false;
}
make_invisible();
return;
The field goes invisible.
Same with creating the playfield in two simple for- loops ( row/line). I take a little delay after every part of the playfield that I add to the group which was previously added to the scene so that every second or so a new part of the playfield should show up on screen. Here I have the same effect, the playfield is shown completely when the script ends but not after the single parts are inserted.
I hope that sounds familiar to some people.
Thanks in advance.
来源:https://stackoverflow.com/questions/60518120/three-js-scene-not-reacting-while-program-is-running