7B5SB3V7YC4HKFX6PIX6IHJ4U3BKYLD5EBMEY6O5FQ7YGN4VVI4AC
N7AJTLSWYZDDPB3JDCRGZVLGX7GCUMHYQB4OAKNETMDHENAZAJCQC
ER6ZNH7MRH3CT66LQR72NYUXOTC2NDKHHDV72VBUHSJGE2VNUXCAC
DOR7S6M2PZ5FQ7TFGWIK7FUFUZENXKU4G42I5HQITODPBBEJB4YQC
GHIHJCWBCGFZI4AG66L7WG4WKJ467DXFBRBNLT4ZULSN7ZVBJI6AC
PAOLWMH7TLJLNAWBJBWP7KB7YGDFUPASMTFU33KZ3QW5JXJMPXCAC
KID2E3YKLHUFPHWYYGRQZTX73THWMAXQWPT5XZEJJO46BCQD27HQC
L6RIUKGLJZLAOKFGUDTZKBPP4HUBPEZAKHJEQHO34WFF62AB2ZIQC
L5SVCVPJMJPDARA4H43U5INQMAKHUIB5PUP55IDRKAPQDB35MXZQC
X5EMQBC4BFNJOOHS2QMF4UB4QH6JKSALK6RXLK6B7SP6MNYSAP6QC
let new_color_a = textureSample(t_world, s_world, in.tex_coords + offset_x * f32(i));
let new_color_b = textureSample(t_world, s_world, in.tex_coords - offset_x * f32(i));
let new_color_a = textureSample(t_world, s_world, t_tex_coords + offset_x * f32(i));
let new_color_b = textureSample(t_world, s_world, t_tex_coords - offset_x * f32(i));
let new_color_c = textureSample(t_world, s_world, in.tex_coords + offset_y * f32(i));
let new_color_d = textureSample(t_world, s_world, in.tex_coords - offset_y * f32(i));
let new_color_c = textureSample(t_world, s_world, t_tex_coords + offset_y * f32(i));
let new_color_d = textureSample(t_world, s_world, t_tex_coords - offset_y * f32(i));
let new_color_e = textureSample(t_world, s_world, in.tex_coords + offset_x * f32(i) + offset_y * f32(i));
let new_color_f = textureSample(t_world, s_world, in.tex_coords + offset_x * f32(i) - offset_y * f32(i));
let new_color_e = textureSample(t_world, s_world, t_tex_coords + offset_x * f32(i) + offset_y * f32(i));
let new_color_f = textureSample(t_world, s_world, t_tex_coords + offset_x * f32(i) - offset_y * f32(i));
let new_color_g = textureSample(t_world, s_world, in.tex_coords + offset_x * f32(i) + offset_y * f32(i));
let new_color_h = textureSample(t_world, s_world, in.tex_coords - offset_x * f32(i) + offset_y * f32(i));
let new_color_g = textureSample(t_world, s_world, t_tex_coords + offset_x * f32(i) + offset_y * f32(i));
let new_color_h = textureSample(t_world, s_world, t_tex_coords - offset_x * f32(i) + offset_y * f32(i));
// Why does this work? rn i haven't the foggiest
let view_vector = glam::Vec2::new(self.width, self.height)
* WORLD_HALF_EXTENTS.as_vec2().recip() // 1 / (GW / 2) = 2 / GW
* 0.25;
// VW * 2 / (GW * 4) = (VW / GW) * 1/2
// dbg!(view_vector);
// rotate about the translation point
glam::Vec3::new(
(self.transform.translation.x * self.width + self.width * 0.25)
/ WORLD_HALF_EXTENTS.x as f32,
(self.transform.translation.y * self.height + self.height * 0.25)
/ WORLD_HALF_EXTENTS.y as f32,
0.0,
),
) * glam::Affine3A::from_translation(glam::Vec3::new(
-(self.transform.translation.x * self.width + self.width * 0.25)
/ WORLD_HALF_EXTENTS.x as f32,
-(self.transform.translation.y * self.height + self.height * 0.25)
/ WORLD_HALF_EXTENTS.y as f32,
0.0,
));
view_vector.extend(0.0),
) * glam::Affine3A::from_translation(-view_vector.extend(0.0));
view * rotation * proj * display_to_texture
world_to_camera
* view
* rotation
* proj
* glam::Affine3A::from_scale(
WORLD_HALF_EXTENTS.as_vec2().extend(1.0) * 0.5
/ glam::Vec3::new(
WORLD_HALF_EXTENTS.x as f32 / self.width,
WORLD_HALF_EXTENTS.y as f32 / self.height,
1.0,
),
)
glam::Vec3::new(0.75, 0.75, 0.0)
glam::Vec3::new(0.75, 0.5, 0.0)
);
camera.transform *= glam::Affine3A::from_axis_angle(glam::Vec3::Z, std::f32::consts::PI);
let vpjm = camera.build_view_projection_matrix();
assert_abs_diff_eq!(
vpjm.project_point3(glam::Vec3::new(0.0, 0.0, 0.0)),
glam::Vec3::new(0.75, 0.5, 0.0)
);
assert_abs_diff_eq!(
vpjm.project_point3(glam::Vec3::new(1.0, 1.0, 0.0)),
glam::Vec3::new(0.25, 0.25, 0.0)
);
camera.transform.translation.x = 0.0;
camera.transform.translation.y = 0.0;
let vpjm = camera.build_view_projection_matrix();
assert_abs_diff_eq!(
vpjm.project_point3(glam::Vec3::new(0.0, 0.0, 0.0)),
glam::Vec3::new(1.0, 0.75, 0.0),