processing / processing/p5.js

3D Coordinate Compatibility in `image()`

Open
#5,861 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area:Image Area:WebGL Enhancement
Dominant language
JavaScript
Stars
24k
Forks
3.8k
Avg merge
3d 16h
Merged PRs (30d)
25

Description

Increasing Access

Unsure

Most appropriate sub-area of p5.js?
  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • Build Process
  • Unit Testing
  • Internalization
  • Friendly Errors
  • Other (specify if possible)
Feature enhancement details

Currently the image() function doesn't support 3D coordinate system, only 2D. I have found myself using a helper function like this very often when I had needed a 3D coordinate support:

function image3d(img, x, y, z) {
    push()
    translate(x + width / 2, y + height / 2, z)
    texture(img)
    noStroke()
    plane(img.width, img.height)
    pop()
}

I feel it is a very simple yet useful enhancement to add, as discussed with @davepagurek earlier.

Thank you!

Contributor guide

Open the contributing guide

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 reading the existing image() entry point and comparing its behavior with the issue's image3d helper using translate(), texture(), and plane(). Determine how 3D coordinates should behave in the image() API, then verify that WebGL image rendering accepts the added coordinate while preserving existing 2D behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
computer-graphics
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.