Skip to content

Commit 301c4b9

Browse files
committed
set camera orientation using the image!
1 parent 7f733c5 commit 301c4b9

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

src/frontend/view/main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,13 @@ int main(int argc, char** argv)
9494

9595
runtime->mergeParametersFrom(cmd.UserEntries);
9696

97+
runtime->setCameraOrientation(runtime->initialCameraOrientation());
9798
if (!cmd.ContinueImage.empty())
9899
runtime->loadPreviousFramebuffer(cmd.ContinueImage);
99100

100101
timer_loading.stop();
101102

102-
const auto def = runtime->initialCameraOrientation();
103+
const auto def = runtime->getCameraOrientation();
103104
CameraProxy camera(cmd.EyeVector().value_or(def.Eye), cmd.DirVector().value_or(def.Dir), cmd.UpVector().value_or(def.Up));
104105
runtime->setCameraOrientation(camera.asOrientation());
105106

src/runtime/Runtime.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -928,6 +928,15 @@ bool Runtime::loadPreviousFramebuffer(const Path& path)
928928
if (metaData.Seed.has_value() && mOptions.Seed == *metaData.Seed)
929929
mOptions.Seed = metaData.Seed.value() + 1; // We HAVE to change the seed to render something new
930930

931+
if (metaData.CameraDir.has_value()
932+
&& metaData.CameraEye.has_value()
933+
&& metaData.CameraUp.has_value()) {
934+
setCameraOrientation(CameraOrientation{
935+
.Eye = *metaData.CameraEye,
936+
.Dir = *metaData.CameraDir,
937+
.Up = *metaData.CameraUp });
938+
}
939+
931940
IG_LOG(L_INFO) << "Continuing rendering from " << mCurrentSampleCount << " samples per pixel." << std::endl;
932941

933942
return true;

0 commit comments

Comments
 (0)