Updating the docs for triangle_strip #848
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @ksen0 and @davepagurek,
The example in the docs now renders as a single solid colour instead of a rainbow because of p5 issue #7722.
In p5 1.x, modes such as
TRIANGLES
,TRIANGLE_STRIP
,QUAD_STRIP
, andQUADS
quietly split the geometry into many sub-shapes, so you could call fill() between vertex() calls and get different colours per polygon. The new 2-D shape engine in 2.0 treats eachbeginShape()/endShape()
block as one path and therefore locks it to the initial fill/stroke. A future fix will probably restore per-polygon colouring for those modes (without interpolation, unlike WebGL) while keeping the single-colour fast path when the style doesn’t change.Until that enhancement lands, the simplest way to keep the rainbow example working is to run it on a WEBGL canvas; WebGL still supports per-vertex colours. I’ve updated the PR accordingly so users won’t be puzzled by a solid-red ring in the docs. Once processing/p5.js#7722 is resolved on dev-2.0, we can switch the example back to the standard 2-D renderer.