Application prototype #14

Merged
glen merged 101 commits from app-proto into main 2024-10-21 23:38:28 +00:00
2 changed files with 6 additions and 6 deletions
Showing only changes of commit e2d3af2867 - Show all commits

View File

@ -266,7 +266,7 @@ pub fn Display() -> View {
frames_since_last_sample = 0;
}
// find the map from construction space to world space
// find the map from assembly space to world space
let location = {
let u = -location_z;
DMatrix::from_column_slice(5, 5, &[
@ -277,12 +277,12 @@ pub fn Display() -> View {
0.0, 0.0, 0.0, 0.0, 1.0
])
};
let construction_to_world = &location * &orientation;
let assembly_to_world = &location * &orientation;
// get the construction
// get the assembly
let elements = state.assembly.elements.get_clone();
let element_iter = (&elements).into_iter();
let reps_world: Vec<_> = element_iter.clone().map(|elt| &construction_to_world * &elt.rep).collect();
let reps_world: Vec<_> = element_iter.clone().map(|elt| &assembly_to_world * &elt.rep).collect();
let colors: Vec<_> = element_iter.map(|elt| elt.color).collect();
// set the resolution
@ -291,7 +291,7 @@ pub fn Display() -> View {
ctx.uniform2f(resolution_loc.as_ref(), width, height);
ctx.uniform1f(shortdim_loc.as_ref(), width.min(height));
// pass the construction
// pass the assembly
ctx.uniform1i(sphere_cnt_loc.as_ref(), elements.len() as i32);
for n in 0..reps_world.len() {
let v = &reps_world[n];

View File

@ -13,7 +13,7 @@ struct vecInv {
// --- uniforms ---
// construction
// assembly
const int SPHERE_MAX = 200;
uniform int sphere_cnt;
uniform vecInv sphere_list[SPHERE_MAX];