playcanvas / playcanvas/engine
Camera worldToScreen wrong results with fixed resolution
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 16.8k
- Forks
- 2k
- Avg merge
- 4h 32m
- Merged PRs (30d)
- 222
Description
This came up in a client's project, when using a fixed resolution in the project settings the camera world to screen method returns a wrong position.
The issue seems to be because it's using the device.clientRect instead of the device width and height.
Here is a sample project that reproduces that, together with two temp workarounds:
Contributor guide
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.
Research direction
Start by locating the camera worldToScreen implementation and compare its use of device.clientRect with the device width and height. Reproduce the issue using the linked sample project with a fixed resolution, then verify that the returned screen position is correct under that setting.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- computer-graphics, game-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100