playcanvas / playcanvas/engine

Camera.screenToWorld issue with non-uniform scale (self or ancestors).

Open
#2,834 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
16.8k
Forks
2k
Avg merge
4h 32m
Merged PRs (30d)
222

Description

Description

Camera.screenToWold returns wrong results when camera entity or any of ancestors are scaled non-unoformly, for exampe (1.0, 0.8, 0.5).

Example project with issue: https://playcanvas.com/editor/scene/1084507

Steps to Reproduce
  1. Launch
  2. Click on surfaces
    Point will be in wrong places.

If Camera entity scale is set to uniform value, then issue is gone.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue in the linked PlayCanvas example by launching it and clicking surfaces with a non-uniformly scaled camera or ancestor. Start by locating the Camera.screenToWorld implementation and its coordinate-transform tests, then verify that clicked points map to the correct surfaces under non-uniform scale.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.