nmwsharp / nmwsharp/polyscope

`screen_coords_to_world_pos` and SSAA

オープン
#275 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
C++
スター
2.2k
フォーク
242
平均マージ
11分
マージ済み PR(30日)
1

説明

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.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

提供された Python の再現コードを、SSAA を無効にした状態と有効にした状態で実行し、screen_coords_to_world_position と set_SSAA_factor から調査を始めてください。レポートによると現在も動作しているネイティブの Selection パスと、座標の扱いを比較してください。SSAA が有効なときに screen_coords_to_world_position が三角形上で有限の位置を返し、ホバーラベルが表示されれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
cpp, python
領域
api, computer-graphics
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
42/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。