`screen_coords_to_world_pos` and SSAA
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Domain
- api, computer-graphics
Research direction
Run the provided Python reproduction with SSAA disabled and enabled, starting at screen_coords_to_world_position and set_SSAA_factor. Compare its coordinate handling with the native Selection path, which the report says still works. Done means screen_coords_to_world_position returns finite positions over the triangle when SSAA is enabled, so the hover label appears.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- C++
- Stars
- 2.2k
- Forks
- 242
- Avg merge
- 11m
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nmwsharp/polyscope
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
-
Rust Version Open
Difficulty 5/5 Over a week Newbie friendliness 15/100
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 20/100
All issues in nmwsharp/polyscope
Similar issues
-
bug build
Difficulty 1/5 Under an hour Newbie friendliness 91/100
facebookincubator/velox#19194 ·
-
JIT-compiled number -> Decimal conversion silently overflows instead of raising DECIMAL_OVERFLOW Openfuzz
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
ClickHouse/ClickHouse#122114 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
module/agent platform/macos type/bug/regression
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
enhancement PyCDE
Difficulty 2/5 1-3 hours Newbie friendliness 78/100