Intel® Embree Ray Tracing Kernels
Discussion forum on the open source ray tracing kernels for fast photo-realistic rendering on Intel® CPU(s)
Announcements
All support for Intel NUC 7 - 13 systems has transitioned to ASUS. Read latest update.

Bug when inverting embree::OrthonormalSpace3f ?

Clemens_E_1
Beginner
315 Views

Hi,

I think I found a bug.
When calculating the inverse of an instance of embree::OrthonormalSpace3f via rcp(..) the resulting translation is wrong. I tracked down the problem to line 86 in common/math/affinespace.h:

  template<typename L> __forceinline AffineSpaceT<L>        rcp( const AffineSpaceT<L>& a ) { L il = rcp(a.l); return AffineSpaceT<L>(il,-il*a.p); }

Because of operator precedence, "-"  is evaluated before "*". It makes no difference for rotation matrices but makes problems for quaternions (negating them does not change orientation). So rather do

  template<typename L> __forceinline AffineSpaceT<L>        rcp( const AffineSpaceT<L>& a ) { L il = rcp(a.l); return AffineSpaceT<L>(il,-(il*a.p)); }

Can anybody confirm this?

Best,

clemens

0 Kudos
1 Reply
SvenW_Intel
Moderator
315 Views

I think you are right, that is a bug. I just committed the fix.

0 Kudos
Reply