`screen_coords_to_world_pos` and SSAA

未关闭
#275 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
42/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
cpp, python

调研方向

运行提供的 Python 复现,在禁用和启用 SSAA 的情况下分别进行,并从 screen_coords_to_world_position 和 set_SSAA_factor 开始。将其坐标处理方式与原生的 Selection 路径进行比较,报告称后者仍然正常工作。完成标准是:启用 SSAA 时,screen_coords_to_world_position 在三角形范围内返回有限位置,从而显示悬停标签。

由索引模型根据 Issue 内容生成。

描述

I am having trouble getting screen_coords_to_world_pos to work with SSAA on:

import numpy as np
import polyscope as ps
import polyscope.imgui as psim


pos = np.array([[-1, 0, 0], [1, 0, 0], [0, 1, 0]])
vtx = [[0, 1, 2]]

ps.init()
ps.register_surface_mesh("tri", pos, vtx)
ps.set_ground_plane_mode("none")

def callback():
    io = psim.GetIO()

    screen_coords = io.MousePos
    world_pos = ps.screen_coords_to_world_position(screen_coords)

    if np.all(np.isfinite(world_pos)):
        psim.TextUnformatted("Hover!")

#ps.set_SSAA_factor(4)

ps.set_user_callback(callback)
ps.show()

Without SSAA, the above runs fine, the label correctly appears when the mouse hovers the triangle. This is no longer the case when the line #ps.set_SSAA_factor(4) is uncommented (or enabled in UI).

Is there a transformation that needs to be applied to the screen_coords with SSAA enabled?
Incidentally, picking seems to work fine, as in the native "Selection" box shows the correct info when clicking on the triangle.

主要语言
C++
星标
2.2k
派生
242
平均合并
11 分钟
30 天内合并 PR
1

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

nmwsharp/polyscope 的其他 Issue

查看 nmwsharp/polyscope 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。