processing / processing/processing4
PShape setFill(indx, color) not working in Processing 4
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Java
- Star
- 494
- Fork
- 183
- Merge trung bình
- 4 giờ 39 phút
- Pull request đã merge (30 ngày)
- 3
Mô tả
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
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng cách lần theo PShape.setFill(int, color) qua đường dẫn OpenGL của Processing 4, sử dụng sketch được cung cấp để tái hiện hành vi. So sánh hành vi hiện tại với Processing 2.2.1 và 3.5.4 nếu có thể, đồng thời xác minh rằng việc nhấp chuột sẽ thay đổi màu của các đỉnh trên PShape ban đầu mà không tạo một đối tượng thứ hai.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- java
- Lĩnh vực
- computer-graphics
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 25/100