mattdesl / mattdesl/webgl-lines

Perspective not corrected

Open
#8 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
435
Forks
37
PR merge metrics
No merged PRs in 30d

Description

I checked out your code, adapted to my purposes, and noticed that the perspective doesn't seem to be corrected in the vertex shader. The lines further away from camera are indeed getting thinner. I then cloned your repo, played a bit with the view and projection matrices, and noticed that it does the same thing. Any idea what's going on and how to correct for perspective and have lines with constant width?

![Imgur](https://i.imgur.com/kRA4o9t.gif)

Also, my code is here https://github.com/skrat/webgl-line-rendering

Contributor guide

No contributing guide indexed for this repository

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

Start by inspecting the vertex shader and the handling of the view and projection matrices in the repository. Reproduce the reported behavior with the supplied perspective setup and compare it with the linked example. Done means perspective is corrected so lines retain constant width as they move farther from the camera.

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
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.