Skip to content

Camera and projection defaults for Python. - #274

Merged
catilac merged 1 commit into
mainfrom
py-camera
Nov 23, 2026
Merged

catilac merged 1 commit into
mainfrom
py-camera

Conversation

@tychedelia

@tychedelia tychedelia commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Camera and projection defaults for Python.

Adds camera(), perspective() and ortho() as Python globals and makes their arguments optional, so they behave like Processing's.

  • camera() with no arguments puts the default mode_3d() view back. camera(eye, center, up) takes three vectors or nine numbers like Processing
  • perspective() arguments are all optional and default to the mode_3d() view (60 degree fov, canvas aspect, near 1, far ten times the camera distance)
  • if you leave out aspect, it follows the canvas, so resizing the window doesn't stretch things
  • ortho() arguments are optional too and default to the canvas bounds, like Processing's ortho()
  • the mode_3d() numbers live in one ViewDefaults now instead of being worked out inline, so all of these use the same values
  • camera() flushes first, so anything drawn before the call keeps the view it was drawn with

The ffi, node and wasm frontends still pass an explicit aspect, so nothing changes for them.

Stack created with GitHub Stacks CLI • Give Feedback 💬

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Visual regression: 1 changed of 43 cases

case status detail
py_flocking_gpu ❌ changed 7.72% of pixels differ

If these changes are intentional, add the deliberate-rendering-change label.

baseline 9a9fb9c5ac · adapter llvmpipe (LLVM 20.1.2, 256 bits) (Vulkan, Mesa 25.2.8-0ubuntu0.24.04.5 (LLVM 20.1.2))

Open the visual report · workflow run

@tychedelia
tychedelia requested a review from catilac November 23, 2026 17:13
@tychedelia
tychedelia marked this pull request as ready for review November 23, 2026 17:13
Base automatically changed from py-core-functions to main November 23, 2026 17:17
@catilac
catilac merged commit a5898c0 into main Nov 23, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants