Intel® Embree Ray Tracing Kernels
Discussion forum on the open source ray tracing kernels for fast photo-realistic rendering on Intel® CPUs.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
265 Discussions

Bug when inverting embree::OrthonormalSpace3f ?

Clemens_E_1
Beginner
120 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
120 Views

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

Reply