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

走远了吗. 提交于 2020-02-23 07:06:11

问题


I am trying to add Lines of two different material i.e. LineDashedMaterial and LineBasicMaterial using Three.js in Forge viewer v7. LineDashedMaterial not showing dashed pattern and material color in scene and sceneAfter but working in overlays scene same for 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);

回答1:


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:

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)? Is the output in the screenshot what you are after? Here's my live demo...



来源:https://stackoverflow.com/questions/60167748/in-forge-viewer-autodesk-v7-linedashmaterial-and-color-for-linebasicmaterial-not

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