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

Add sideWalls optional parameter to cylinder() #7338

Closed
1 of 17 tasks
blackboxlogic opened this issue Oct 29, 2024 · 5 comments
Closed
1 of 17 tasks

Add sideWalls optional parameter to cylinder() #7338

blackboxlogic opened this issue Oct 29, 2024 · 5 comments

Comments

@blackboxlogic
Copy link
Contributor

Increasing access

Allow users to render a circle efficiently when working in 3D.

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
  • Internationalization
  • Friendly errors
  • Other (specify if possible)

Feature request details

cylinder() already has parameters bottomCap and topCap. But there's no way to just draw the cap(s). I'm suggesting adding another optional parameter sideWalls default to true, but when false doesn't draw the side walls of the cylinder.

@davepagurek
Copy link
Contributor

Would placing two circle()s already cover this case?

@blackboxlogic
Copy link
Contributor Author

I didn't see a way to use circle() in 3D space, with webGL. I want to change its xyz, rotate it in 3D, apply lighting etc

@davepagurek
Copy link
Contributor

For all 3D shapes, you can call translate(...) or rotate(...) before your call to circle() to change the position and orientation of whatever you're drawing. I believe that should also include normals, so if you enable lighting and materials before drawing the circles, they should apply.

@blackboxlogic
Copy link
Contributor Author

I assumed, read, or misunderstood that 2-D shapes couldn't be used in 3d space. I've verified that circle() does exactly what I want. Thank you.

@davepagurek
Copy link
Contributor

ok nice! yeah, that's something that maybe could be made clearer in the docs or tutorials too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants