Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kivy.graphics.transformation.Matrix.view_clip() produces incorrect matrix #5881

Closed
DaytonaJohn opened this issue Jul 29, 2018 · 0 comments · Fixed by #5957
Closed

kivy.graphics.transformation.Matrix.view_clip() produces incorrect matrix #5881

DaytonaJohn opened this issue Jul 29, 2018 · 0 comments · Fixed by #5957
Assignees
Labels
Component: core-providers kivy/core Component: graphics kivy/graphics Status: Needs-analysis Issue needs to be analyzed if it's real

Comments

@DaytonaJohn
Copy link

The code producing the view_clip matrix has an incorrect value for matrix element 10. The kivy code sets element 10 to 2/(far-near), but numerous sources indicate that the correct value is -2/(far-near):

Versions

  • Python: 3.6.5
  • OS: Ubuntu 18.04
  • Kivy: v1.11.0.dev0

Description

While trying to use an orthographic projection in the kivy example 3Drendering, I was unable to get satisfactory results. After lengthy investigation, I realized that the matrix produced by Matrix().view_clip() is incorrect when the perspective argument is 0.

Code and Logs

Simply changing the perspective argument in the line:

    proj = Matrix().view_clip(-asp, asp, -1, 1, 1, 100, 1)

from 1 to 0 in update_glsl() in main.py, results in a black screen (no obj displayed). Correcting the element in question with the lines below:

    proj = Matrix().view_clip(-asp, asp, -1, 1, 1, 100, 0)
    proj[10] = -proj[10]

produces the correct result.

@KeyWeeUsr KeyWeeUsr added Component: graphics kivy/graphics Component: core-providers kivy/core Status: Needs-analysis Issue needs to be analyzed if it's real labels Jul 30, 2018
@tshirtman tshirtman added this to evaluation in Sprint pycon-fr 2018 Oct 4, 2018
@tito tito moved this from todo to working in Sprint pycon-fr 2018 Oct 5, 2018
@tito tito self-assigned this Oct 5, 2018
@tito tito moved this from working to done in Sprint pycon-fr 2018 Oct 5, 2018
Sprint pycon-fr 2018 automation moved this from done to closed Oct 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: core-providers kivy/core Component: graphics kivy/graphics Status: Needs-analysis Issue needs to be analyzed if it's real
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

3 participants