Autodesk Forge Viewer中的近和远计算 [英] near and far calculation in Autodesk Forge Viewer

查看:91
本文介绍了Autodesk Forge Viewer中的近和远计算的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Forge Viewer中,近距离和远距离计算是通过内部的 updateCameraMatrices 方法完成的.在这种方法中,存在一种最终的启发式方法,可以更好地微调靠近31320行的近值:

In Forge Viewer, the near and far calculation is done in an internal updateCameraMatrices method. In that method, there's a final heuristic to fine-tune the near value better near line 31320:

// One more attempt to improve the near plane: make it 1/100,000 of the distance of the
// far plane, if that's higher.
// See https://wiki.autodesk.com/display/LMVCORE/Z-Buffer+Fighting for reasoning.
// 1e-4 is generally good below, but inside Silver Cross we get a lot of near clipping. So, 1e-5.
dMin = Math.max(dMin, dMax * 1e-5);

在某些BIM模型中,我加载到查看器中,可以看到在某些视角下的Z角战斗.如果我按照注释中的说明将值从1e-5(1/100,000)更改为1e-4(1/10,000),则z格斗将不存在.对于大型模型(例如建筑物),这似乎更合适.它可能不太适合3D CAD模型之类的小规模模型.

In some BIM models I load in the viewer I can see Z-fighting for some viewing angles. If I change the value from 1e-5 (1/100,000) to 1e-4 (1/10,000) as noted in the comments, the z-fighting is gone. This also seems like a much more appropriate value for large models (like buildings). It's maybe less suited for small-scale models like 3D CAD models.

如果我要渲染的只是建筑物规模的模型(来自Revit,Navisworks等),我可以安全地将此值更改为1e-4吗?

Can I safely change this value to 1e-4 if all I intend to render is models in the scale of buildings (from Revit, Navisworks etc)?

Forge Viewer允许在其API中配置近/远计算吗?

Will the Forge Viewer allow to configure the near/far calculation in its API?

推荐答案

恐怕您不应该直接在 viewer3D.js 文件中修改此值.不建议这样做.据我所知,也没有此类API可以修改此值.

I'm afraid that you shouldn't modify this value directly in the viewer3D.js file. It's not recommended to do so. There also is no such API to modify this value as I know.

但是,您是否尝试过更改查看器的边界?您可以参考以下类似情况:添加天空盒

However, have you tried to change the bounds of the viewer? Here might be a similar case you can refer: Adding a skybox

如果这与您的需求不符,您可以提供一些快照和更多详细信息向我演示此问题吗?如果您这样做,我很高兴将其传递给我们的工程团队进行进一步调查.如果无法公开发布,则可以将这些材料发送到 forge.help@autodesk.com .

If this doesn't match what you need, could you provide some snapshots and more detail information demonstrating this issue to me? If you do so, I 'm glad to pass it to our engineering team for further investigating. You can send those materials to forge.help@autodesk.com if it cannot be posted publicly.

P.S.请从您发送给我们的所有邮件中删除机密信息.

这篇关于Autodesk Forge Viewer中的近和远计算的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆