简体   繁体   English

在Three.js中将轨道控件与多个重叠场景结合使用

[英]Use of Orbit Controls with Multiple Overlapping Scenes in Three.js

I would appreciate some help in solving a problem related to the use of Orbit Controls with Multiple Overlapping Scenes. 对于解决与多个重叠场景的轨道控件的使用相关的问题,我将不胜感激。

In order to demonstrate the problem I modified the example in multiple scenes and I created a test which is suitable for my developments. 为了演示该问题,我在多个场景中修改了示例,并创建了一个适合我的开发的测试。 The code is available at: test with orbit controls and multiple scenes 该代码可在以下位置获得: 使用轨道控件和多个场景进行测试

In my case I need to implement two scenarios 就我而言,我需要实现两种情况

One scenario with three scenes where each scene occupies part of the web page (div elements … scene0, scene1 and scene … using CSS style) and A second scenario with one scene on the full space of the web page (div elements … scene0, scene1 and scene … using CSS style) 一种场景是三个场景,每个场景都占据了网页的一部分(div元素…scene0,scene1和scene…使用CSS样式),第二种场景是一个场景在网页的整个空间上(div元素…scene0,scene1和场景…使用CSS样式)

In this example, it is possible to switch between the two scenarios by clicking and pushing the shift button on the keyboard simultaneously. 在此示例中,可以通过同时单击并按下键盘上的Shift按钮来在两种情况之间切换。

It appears to work fine but in one of the two scenarios the Orbit Controls is not working. 它似乎工作正常,但是在两种情况之一中,“轨道控制”都无法正常工作。

I have tried to change some parameters : 我试图更改一些参数:

            element.style.zIndex = "6";
            element.style.order = "6";
            scene.renderOrder = 1.;

But nothing changes. 但是什么都没有改变。

I would highly appreciate some help at this point since I cannot find a similar case on this issue. 由于无法在此问题上找到类似的案例,因此我非常感谢您的帮助。 Cheers, ilias 伊利亚斯干杯

Try to add pointer-events: none; 尝试添加pointer-events: none; to your CSS when you switch. 切换到CSS时。

https://developer.mozilla.org/en-US/docs/Web/CSS/pointer-events https://developer.mozilla.org/en-US/docs/Web/CSS/pointer-events

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM