Three.js scene not reacting while program is running

大城市里の小女人 提交于 2021-01-29 14:50:36

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!