POV-Ray : Newsgroups : povray.programming : OT - need help tracking a (few) bug(s) in my little raytracer (C++) : Re: OT - need help tracking a (few) bug(s) in my little raytracer(C++) Server Time
28 Jul 2024 12:25:46 EDT (-0400)
  Re: OT - need help tracking a (few) bug(s) in my little raytracer(C++)  
From: Vahur Krouverk
Date: 8 Aug 2001 14:18:28
Message: <3B718365.C2F57AE1@comtrade.ee>
Thorsten Froehlich wrote:
> 
> In article <dsh2nt03gaj1u2o17rgsiblue403sip45i@4ax.com> , Peter Popov
> <pet### [at] vipbg>  wrote:
> 
> > c) boxes and spheres disappear when translated. Well, they might not
> > disappear, but they translate to the void (outside the field of view)
> > even with a small translation
> 
> In
> 
>     CMatrix CMatrix::operator * (const CMatrix &M1) {
>      unsigned char i, j, k;
>      CMatrix Result = NullMatrix;
> 
>      for (i = 0 ; i < 4 ; i++)
>       for (j = 0 ; j < 4 ; j++)
>        for (k = 0 ; k < 4 ; k++)
>         Result.Elements[i][j] += this->Elements[i][k] * M1.Elements[k][j];
> 
>      return Result;
>     }
> 
> you only return the result but should also copy it into the this-matrix.

Hmm, are you sure in it? Generally such expression
x=y*z; 
should not modify y or z, but your proposal will change y. I guess that
you confuse operator * with operator *= in this case?


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.