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

3D Coordinate Compatibility in image() #5861

Open
2 of 17 tasks
DenisovichDev opened this issue Nov 16, 2022 · 2 comments · May be fixed by #7172
Open
2 of 17 tasks

3D Coordinate Compatibility in image() #5861

DenisovichDev opened this issue Nov 16, 2022 · 2 comments · May be fixed by #7172

Comments

@DenisovichDev
Copy link
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!

@welcome
Copy link

welcome bot commented Nov 16, 2022

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
Copy link
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().)

@Forchapeatl Forchapeatl linked a pull request Aug 15, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Features Don't Work in All Contexts
Development

Successfully merging a pull request may close this issue.

2 participants