Fix bugs for pbrt bilinear patch

This commit is contained in:
hal8174 2025-08-27 19:06:47 +02:00
parent bb2089477e
commit 0480e041cd
Signed by: hal8174
SSH key fingerprint: SHA256:NN98ZYwnrreQLSOV/g+amY7C3yL/mS1heD7bi5t6PPw
6 changed files with 85 additions and 33 deletions

View file

@ -483,7 +483,11 @@ fn parse_transform(input: &mut Tokenizer) -> Result<AffineTransform> {
}
fn parse_translate<R>(iter: &mut Tokenizer) -> Result<Statement<R>> {
let pos = Pos3::new(iter.parse_next()?, iter.parse_next()?, iter.parse_next()?);
let pos = Pos3::new(
-iter.parse_next()?,
-iter.parse_next()?,
-iter.parse_next()?,
);
Ok(Statement::ConcatTransform(AffineTransform::translation(
pos,
@ -592,7 +596,7 @@ impl<R: Rng> Pbrt<R> {
scene: PbrtScene {
shapes: Vec::new(),
infinite_light: Some(scene::PbrtInfiniteLight {
color: Color::white(),
color: Color::new(0.4, 0.45, 0.5),
}),
},
}