`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 摘要。