René's URL Explorer Experiment


Title: ortho broken (again) - suggested simple fix · Issue #6175 · processing/processing · GitHub

Open Graph Title: ortho broken (again) - suggested simple fix · Issue #6175 · processing/processing

X Title: ortho broken (again) - suggested simple fix · Issue #6175 · processing/processing

Description: Description ortho is broken and doesn't work as expected. I found other bug reports on this but they were >7 years old so I'm reposting, a lot has changed since then. Expected Behavior ortho(0, width, 0, height), with a clear modelview m...

Open Graph Description: Description ortho is broken and doesn't work as expected. I found other bug reports on this but they were >7 years old so I'm reposting, a lot has changed since then. Expected Behavior ortho(0, wid...

X Description: Description ortho is broken and doesn't work as expected. I found other bug reports on this but they were >7 years old so I'm reposting, a lot has changed since then. Expected Behavior o...

Opengraph URL: https://github.com/processing/processing/issues/6175

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ortho broken (again) - suggested simple fix","articleBody":"## Description\r\northo is broken and doesn't work as expected. I found other bug reports on this but they were \u003e7 years old so I'm reposting, a lot has changed since then. \r\n\r\n## Expected Behavior\r\northo(0, width, 0, height), with a clear modelview matrix (resetMatrix), should enable the user to draw within the bounds specified.\r\n\r\n## Current Behavior\r\nIt doesn't work. Because of a bug in the ortho function (see below), this results in the user having to draw within (-height, 0) (all negative) to see. This is wrong and counterintuitive. \r\n\r\nOnline comments about people having to compensate because of some nonsense about left handed or right handed system, or processing's negative y, are blaming the user and proposing workarounds for a clear bug.\r\n\r\n## Steps to Reproduce\r\n```\r\nvoid setup() {\r\n  size(500, 500, P3D);\r\n  setupPOGL(); \r\n}\r\n\r\nvoid draw() {\r\n  ortho(0, width, 0, height);\r\n  resetMatrix(); // clear modelview matrix\r\n  fill(255,255,255);\r\n  //translate(0, -height); // fixes it\r\n  beginShape(TRIANGLES);\r\n  vertex(640, 640);\r\n  vertex(0, 640);\r\n  vertex(0, 0);\r\n  endShape();\r\n}\r\n```\r\n\r\n\r\n\r\n## Your Environment\r\nWindows 10. Processing 3.5.4\r\n\r\n## Possible Causes / Solutions\r\n[https://github.com/processing/processing/blob/master/core/src/processing/opengl/PGraphicsOpenGL.java](url)\r\nLines 4493-4522 highlight the problem.\r\nNote line 4515 says: // The minus sign is needed to invert the Y axis.\r\nAnd then on line 4517 it's -y. What this does is to flip the y axis on zero. Not invert the y axis. This is why when the ortho isn't centered, it puts /all/ the y into the negative space.\r\n\r\nTo fix it is quite simple. To invert the y axis, you just invert the Y in NDC, /after/ the projection into NDC. This can be done by pre-multiplying the projection matrix with a -1 y scale. If you precalculate it, you can see that this can be fixed by simply putting a - also in front of the ty on line 4517\r\n\r\n```\r\n// This has a pre-multiplied -1 y scale to flip the y axis in NDC.\r\n    projection.set(x,  0, 0, tx,\r\n                   0, -y, 0, -ty,\r\n                   0,  0, z, tz,\r\n                   0,  0, 0,  1);\r\n```\r\n\r\nThis is rooted in Processing's unfortunate decision to have the Y axis going down to follow traditional computer coordinate systems. While that decision is defensible, the way it's implemented ad-hoc throughout is really frustrating for any serious graphics programmer. It really should have been added at the bottom level (in NDC or on the viewport), and exposed as a flag that someone could disable.\r\n\r\n","author":{"url":"https://github.com/usuallyannoyed","@type":"Person","name":"usuallyannoyed"},"datePublished":"2021-04-12T14:14:40.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/6175/processing/issues/6175"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:a49873fb-e474-1fdf-0193-f25887d82b9e
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE41E:326BEA:15BC010:1CD16A9:696F03B5
html-safe-nonce843e9216bd5f2349645be1808d1be5fdaa178adee09083e388474ca3ca242410
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNDFFOjMyNkJFQToxNUJDMDEwOjFDRDE2QTk6Njk2RjAzQjUiLCJ2aXNpdG9yX2lkIjoiNjIwMTY3NTMxMTA4MzM1NzEwOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac11593f746fcfd667ae71609b4a02b6fe412923bf9bb7d450c2c6ec2faf38579d
hovercard-subject-tagissue:856023039
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/processing/processing/6175/issue_layout
twitter:imagehttps://opengraph.githubassets.com/af1b8417fc06b3aaabf316caa9fec6ca7236d6d75773b4ebf2b8eb659e5220da/processing/processing/issues/6175
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/af1b8417fc06b3aaabf316caa9fec6ca7236d6d75773b4ebf2b8eb659e5220da/processing/processing/issues/6175
og:image:altDescription ortho is broken and doesn't work as expected. I found other bug reports on this but they were >7 years old so I'm reposting, a lot has changed since then. Expected Behavior ortho(0, wid...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameusuallyannoyed
hostnamegithub.com
expected-hostnamegithub.com
Noneb278ad162d35332b6de714dfb005de04386c4d92df6475522bef910f491a35ee
turbo-cache-controlno-preview
go-importgithub.com/processing/processing git https://github.com/processing/processing.git
octolytics-dimension-user_id1617169
octolytics-dimension-user_loginprocessing
octolytics-dimension-repository_id7807399
octolytics-dimension-repository_nwoprocessing/processing
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id7807399
octolytics-dimension-repository_network_root_nwoprocessing/processing
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release39aed5006635ab6f45e6b77d23e73b08a00272a3
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/processing/processing/issues/6175#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fprocessing%2Fprocessing%2Fissues%2F6175
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fprocessing%2Fprocessing%2Fissues%2F6175
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=processing%2Fprocessing
Reloadhttps://patch-diff.githubusercontent.com/processing/processing/issues/6175
Reloadhttps://patch-diff.githubusercontent.com/processing/processing/issues/6175
Reloadhttps://patch-diff.githubusercontent.com/processing/processing/issues/6175
processing https://patch-diff.githubusercontent.com/processing
processinghttps://patch-diff.githubusercontent.com/processing/processing
Please reload this pagehttps://patch-diff.githubusercontent.com/processing/processing/issues/6175
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Fprocessing%2Fprocessing
Fork 1.5k https://patch-diff.githubusercontent.com/login?return_to=%2Fprocessing%2Fprocessing
Star 6.5k https://patch-diff.githubusercontent.com/login?return_to=%2Fprocessing%2Fprocessing
Code https://patch-diff.githubusercontent.com/processing/processing
Issues 471 https://patch-diff.githubusercontent.com/processing/processing/issues
Pull requests 23 https://patch-diff.githubusercontent.com/processing/processing/pulls
Actions https://patch-diff.githubusercontent.com/processing/processing/actions
Wiki https://patch-diff.githubusercontent.com/processing/processing/wiki
Security Uh oh! There was an error while loading. Please reload this page. https://patch-diff.githubusercontent.com/processing/processing/security
Please reload this pagehttps://patch-diff.githubusercontent.com/processing/processing/issues/6175
Insights https://patch-diff.githubusercontent.com/processing/processing/pulse
Code https://patch-diff.githubusercontent.com/processing/processing
Issues https://patch-diff.githubusercontent.com/processing/processing/issues
Pull requests https://patch-diff.githubusercontent.com/processing/processing/pulls
Actions https://patch-diff.githubusercontent.com/processing/processing/actions
Wiki https://patch-diff.githubusercontent.com/processing/processing/wiki
Security https://patch-diff.githubusercontent.com/processing/processing/security
Insights https://patch-diff.githubusercontent.com/processing/processing/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/processing/processing/issues/6175
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/processing/processing/issues/6175
ortho broken (again) - suggested simple fixhttps://patch-diff.githubusercontent.com/processing/processing/issues/6175#top
https://github.com/usuallyannoyed
https://github.com/usuallyannoyed
usuallyannoyedhttps://github.com/usuallyannoyed
on Apr 12, 2021https://github.com/processing/processing/issues/6175#issue-856023039
https://github.com/processing/processing/blob/master/core/src/processing/opengl/PGraphicsOpenGL.javahttps://patch-diff.githubusercontent.com/processing/processing/issues/url
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.