Color points

In the process, find and correct a misunderstanding about vertex
attributes. Here's my current understanding. Vertex attributes are
program-independent. When you make a draw call, every enabled attribute
has to have a vertex buffer object bound to it. A simple way to make
sure this happens is to enable only the attributes used by the active
program.
This commit is contained in:
Aaron Fenyes 2025-04-25 12:06:21 -07:00
parent 1945086586
commit 0fbb071506
5 changed files with 60 additions and 24 deletions

View file

@ -202,6 +202,7 @@ impl ProblemPoser for Sphere {
pub struct Point {
pub id: String,
pub label: String,
pub color: ElementColor,
pub representation: Signal<DVector<f64>>,
pub regulators: Signal<BTreeSet<RegulatorKey>>,
pub serial: u64,
@ -214,11 +215,13 @@ impl Point {
pub fn new(
id: String,
label: String,
color: ElementColor,
representation: DVector<f64>
) -> Point {
Point {
id,
label,
color,
representation: create_signal(representation),
regulators: create_signal(BTreeSet::default()),
serial: Self::next_serial(),
@ -236,6 +239,7 @@ impl Element for Point {
Point::new(
id,
format!("Point {id_num}"),
[0.875_f32, 0.875_f32, 0.875_f32],
point(0.0, 0.0, 0.0)
)
}