Use full 4x4 matrix for affine transformation

This commit is contained in:
hal8174 2025-08-24 21:31:13 +02:00
parent ae4dc2c21a
commit c48790f32f
Signed by: hal8174
SSH key fingerprint: SHA256:NN98ZYwnrreQLSOV/g+amY7C3yL/mS1heD7bi5t6PPw
2 changed files with 172 additions and 49 deletions

View file

@ -487,6 +487,7 @@ fn parse_transform(input: &mut Tokenizer) -> Result<AffineTransform> {
[v[0], v[4], v[8], v[12]],
[v[1], v[5], v[9], v[13]],
[v[2], v[6], v[10], v[14]],
[v[3], v[7], v[11], v[15]],
])
.ok_or(miette!("Unable to invert transformation"))
}
@ -757,6 +758,7 @@ fn inner_parse_pbrt(path: impl AsRef<Path> + std::fmt::Debug) -> Result<Pbrt> {
*context.ctm.last_mut().unwrap() = affine_transform
}
Statement::Shape(shape_type, shape_alpha) => {
dbg!(&context);
pbrt.scene.shapes.push(Shape {
ctm: context.get_ctm(),
material: Arc::clone(