processing-website icon indicating copy to clipboard operation
processing-website copied to clipboard

Parameters for `vertex()` too confusing.

Open Brahvim opened this issue 3 years ago • 7 comments

Issue description

The parameters are too confusing! v has two meanings.

URL(s) of affected page(s)

https://processing.org/reference/vertex_.html

Proposed fix

Please replace vertex(v) with something like vertex(a), then state that a is a float[].

Brahvim avatar Aug 20 '22 07:08 Brahvim

Hi @SableRaf, I would love to take on this task. I think this should be a good starting task for a newcomer like me.

CubeTures avatar Mar 09 '23 02:03 CubeTures

Okay, after looking into this issue, I have discovered additional problems with the documentation page. I have listed them here along with my suggested solutions.

Issues:

  • Two parameters titled "v," both of which are uninformative
  • The first "v" parameter has an option to be just a float, which does not actually compile.
  • The second"v" parameter has an option to be a float[], which does not compile either.

Solutions:

  • Change the first "v" parameter to be called "point" or "coordinate"
  • Remove the option for float for the first "v" parameter, as it does not work
  • Change the "u" parameter to be "xTexture"
  • Change the second"v" parameter to be called "yTexture"
  • Remove the option for float[] for the second"v" parameter, as it does not work

I will begin to work on getting a merge created. I believe this change will also require changing the parameter names in the actual proccesing4.

CubeTures avatar Mar 09 '23 03:03 CubeTures

Hey there @CubeTures - just saying: thank you very much for noticing this! Pretty stupid of me that I didn't just, think of doing this myself, back then...

I hope you like working on this, ":D!

Brahvim avatar Mar 09 '23 16:03 Brahvim

Okay, that should do it. I hope I didn't miss any references of the method elsewhere. Please tell me if you notice anything!

CubeTures avatar Mar 10 '23 04:03 CubeTures

Hello, @CubeTures. How about you specify the parameters for the overload vertex(x, y, z, u, v) as vertex(x, y, z, s, t) instead? (That is a well-known OpenGL convention!)

The last parameter in the "Parameters" section, v (float, float[]) is, as you called it, confusing, since it conflicts with the first one. How about removing it?

Also, as you mentioned, vertex(v) does not actually work with just a single float anywhere. Could you please also fix this error in the docs?

Also, an explanation for what VERTEX_FIELD_COUNT is, would be beneficial (and appreciated! ":D).

Brahvim avatar Mar 10 '23 06:03 Brahvim

Alright, I redid my pull request to better reflect the conventions you listed, as well as clarified the vertex field count. Thanks for letting me know!

CubeTures avatar Mar 10 '23 15:03 CubeTures

Thank you! I went through the commits, they look nice to me. Hope to see these changes on the site soon! ":D

Brahvim avatar Mar 10 '23 18:03 Brahvim