简体   繁体   English

在 Forge Viewer Autodesk v7 LineDashMaterial 和 LineBasicMaterial 的颜色不起作用

[英]In Forge Viewer Autodesk v7 LineDashMaterial and color for LineBasicMaterial not working

I am trying to add Lines of two different material ie LineDashedMaterial and LineBasicMaterial using Three.js in Forge viewer v7.我正在尝试在 Forge 查看器 v7 中使用 Three.js 添加两种不同材质的线条,即 LineDashedMaterial 和 LineBasicMaterial。 LineDashedMaterial not showing dashed pattern and material color in scene and sceneAfter but working in overlays scene same for LineBasicMaterial. LineDashedMaterial 未在场景和场景之后显示虚线图案和材质颜色,但在与 LineBasicMaterial 相同的叠加场景中工作。 but my requirement is to add line in scene and sceneAfter.但我的要求是在场景和场景之后添加行。 can anyone tell me solution for this.谁能告诉我解决方案。 thanks in advance.提前致谢。

 let geometry = new THREE.Geometry();
 geometry.vertices.push(new THREE.Vector3(0, 0, 0),
                        new THREE.Vector3(0, 0, 100));
let  material = new THREE.LineDashedMaterial({color: 0xFF0000,
                                              dashSize: 3,
                                              gapSize: 1});
geometry.computeLineDistances();
geometry.lineDistancesNeedUpdate = true;
viewer.impl.matman().addMaterial('material', material, true);
let line= new THREE.Line(geometry, material);
viewer.impl.sceneAfter.add(line);

EDIT编辑

Engineering has now been made aware of the issue and will fix this in upcoming releases.工程现在已经意识到这个问题,并将在即将发布的版本中解决这个问题。

For now as a workaround you can switch off the DepthTarget option for sceneAfter to fix MRT support - see demo here :现在作为一个变通方法,您可以关闭DepthTarget选项sceneAfter修复MRT支持-看演示在这里

NOP_VIEWER.impl.sceneAfter.skipDepthTarget = true;
NOP_VIEWER.impl.sceneAfter.skipIdTarget = true;

But I was able to render the dashed pattern with Viewer v7.11 with sceneAfter (on Chrome v70 though)?但是我能够使用带有sceneAfter Viewer v7.11渲染虚线图案(尽管在Chrome v70上)? Is the output in the screenshot what you are after?屏幕截图中的输出是您所追求的吗? Here's my live demo ...这是我的现场演示...

在此处输入图片说明

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

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