Skip to content

3D Coordinate Compatibility in image() #5861

Open
@DenisovichDev

Description

@DenisovichDev
Contributor

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!

Activity

welcome

welcome commented on Nov 16, 2022

@welcome

Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, please make sure to fill out the inputs in the issue forms. Thank you!

davepagurek

davepagurek commented on Nov 16, 2022

@davepagurek
Contributor

Thanks for filing this issue! I think it makes a lot of sense, especially since most other p5 methods let you specify a z coordinate when you go from 2D to 3D.

I think the biggest challenge in implementing this will be in reading the arguments list properly. I think the new method signature would be:

image(img, x, y, [z], [width], [height])

image(img, dx, dy, [dz], dWidth, dHeight, sx, sy, [sWidth], [sHeight], [fit], [xAlign], [yAlign])

I think it should still be unambiguous to parse it out though since we're just adding one new optional number in the start (adding two would probably make clashes the longer form of image().)

moved this to Features Don't Work in All Contexts in p5.js WebGL Projectson Oct 27, 2023
linked a pull request that will close this issue on Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Features Don't Work in All Contexts

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @davepagurek@DenisovichDev

      Issue actions

        3D Coordinate Compatibility in `image()` · Issue #5861 · processing/p5.js