processing / processing/processing4
PShape setFill(indx, color) not working in Processing 4
还没有人认领这个 Issue。
- 主要语言
- Java
- 星标
- 494
- 派生
- 183
- 平均合并
- 4 小时 39 分钟
- 30 天内合并 PR
- 3
描述
Most appropriate sub-area of Processing 4?
OpenGL
Processing version
4.3
Operating system
MacOSX
Steps to reproduce this
"1. The source code below demonstrates the problem. The PShape should change color when the mouse is clicked.
-
The source code runs correctly in versions 2.2.1 (macos) and 3.5.4 (reported by another forum member running Windows) indicating a runtime code change prior to version 4.
-
There is a similar report from a year ago: https://github.com/processing/processing4/issues/677"
-
We would like to change the vertex colors of the original PShape object without having to create a second object.
snippet
PShape t;
void setup() {
size(400, 400, P2D);
surface.setTitle("Should change color when mouse clicked.");
t = createShape();
t.beginShape();
t.vertex(200, 100);
t.vertex(100, 300);
t.vertex(300, 300);
t.endShape(CLOSE);
for (int i = 0; i < t.getVertexCount(); i++) {
t.setFill(i, color(random(255), random(255), random(255)));
}
}
void draw() {
background(209);
shape(t);
}
void mousePressed() {
for (int i = 0; i < t.getVertexCount(); i++) {
t.getVertex(i);
t.setFill(i, color(random(255), random(255), random(255)));
}
}
Additional context
No response
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先沿着 Processing 4 的 OpenGL 路径跟踪 PShape.setFill(int, color),使用提供的 sketch 重现该行为。如果可用,请将当前行为与 Processing 2.2.1 和 3.5.4 进行比较,并验证点击鼠标会改变原始 PShape 的顶点颜色,而不会创建第二个对象。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- java
- 领域
- computer-graphics
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 25/100