File tree Expand file tree Collapse file tree
src/nbl/ext/MitsubaLoader Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -258,10 +258,14 @@ std::optional<SNamedPropertyElement> CPropertyElementManager::createPropertyData
258258 up[index] = 1 .f ;
259259 }
260260 // TODO: after the rm-core matrix PR we need to get rid of the tranpose (I transpose only because of GLM and HLSL mixup)
261- const auto lookAtGLM = reinterpret_cast <const hlsl::float32_t4x4&>(glm::lookAtLH<float >(origin,target,up));
262- const auto lookAt = hlsl::transpose (lookAtGLM);
261+ // const auto lookAtGLM = reinterpret_cast<const hlsl::float32_t4x4&>(glm::lookAtLH<float>(origin,target,up));
262+ // const auto lookAt = hlsl::transpose(lookAtGLM);
263+ const auto lookAt = hlsl::math::linalg::rhLookAt (origin, target, up);
263264 // mitsuba understands look-at and right-handed camera little bit differently than I do
264265 const auto rotation = hlsl::inverse (hlsl::float32_t3x3 (lookAt));
266+ for (auto i = 0 ; i < 3 ; i++)
267+ for (auto j = 0 ; j < 3 ; j++)
268+ result.mvalue [i][j] = rotation[i][j];
265269 // set the origin to avoid numerical issues
266270 for (auto r=0 ; r<3 ; r++)
267271 {
You can’t perform that action at this time.
0 commit comments