【发布时间】:2021-12-19 05:13:50
【问题描述】:
我制作了一张信息卡片,如果旋转查看器直到模型不可见,这张卡片就会消失。我使用isNodevisible,但它总是返回true。
updateInfoCard() {
if (this.infoCard && this.posModel) {
const pos = this.viewer.worldToClient(this.posModel);
console.log(pos);
this.infoCard.style.left = `${Math.floor(
50 + pos.x - this.infoCard.offsetWidth / 2
)}px`;
this.infoCard.style.top = `${Math.floor(
50 + pos.y - this.infoCard.offsetWidth / 2
)}px`;
const id = this.infoCard.dataset.id;
console.log(this.viewer.isNodeVisible(id));
this.infoCard.style.display = this.viewer.isNodeVisible(id)
? "block"
: "none";
}
}
【问题讨论】:
标签: autodesk-forge autodesk-viewer