Tune some rendering constants

This commit is contained in:
2020-09-05 14:44:26 -07:00
parent 08461267be
commit 861d7430e2
2 changed files with 5 additions and 4 deletions

View File

@@ -30,7 +30,7 @@ fn main() {
loop {
step += 1;
let imp = if step < 50 {
250000.0 * ((step as f64)*0.04*std::f64::consts::PI).sin()
30000.0 * ((step as f64)*0.04*std::f64::consts::PI).sin()
} else {
0.0
};

View File

@@ -64,7 +64,7 @@ impl SimStateRenderExt for SimState {
for x in 0..w {
let cell = self.get(x as usize, y as usize);
let r = scale_signed_to_u8(cell.mat().mz(), 100.0);
let b = scale_unsigned_to_u8(cell.mat().conductivity(), 10.0);
let b = scale_unsigned_to_u8(cell.mat().conductivity(), 3.0);
let g = scale_signed_to_u8(cell.bz(), 1.0e-4);
image.put_pixel(x, y, Rgb([r, g, b]));
}
@@ -73,8 +73,9 @@ impl SimStateRenderExt for SimState {
for y in 0..h {
for x in 0..w {
if x % evec_spacing == 0 && y % evec_spacing == 0 {
let norm_vec = scale_vector(self.e_vector(x, y, evec_spacing), 100.0);
let alpha = norm_vec.mag_sq().powf(0.33);
let evec = self.e_vector(x, y, evec_spacing);
let norm_vec = scale_vector(evec, 100.0);
let alpha = scale_unsigned(evec.mag_sq(), 500.0);
let vec = norm_vec * (evec_spacing as f64);
let center = Point::new(x as _, y as _) + Point::new(evec_spacing as _, evec_spacing as _)*0.5;
image.draw_field_arrow(center, vec, Rgb([0xff, 0xff, 0xff]), alpha as f32);