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:37:52 EDT (-0400)
  Re: OT - need help tracking a (few) bug(s) in my little raytracer(C++)  
From: Thorsten Froehlich
Date: 8 Aug 2001 14:50:15
Message: <3b7189e7@news.povray.org>
In article <3b71858f@news.povray.org> , "Thorsten Froehlich" 
<tho### [at] trfde> wrote:

> In article <3B718365.C2F57AE1@comtrade.ee> , Vahur Krouverk
> <vkr### [at] comtradeee>  wrote:
>
>> 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?

I check.  Of course you are right, I confused it...

I guess I should concentrate or not answer a question.  Sorry for the
confusion, Peter!  thanks for noticing my mistake Vahur!

I canceled my previous two posts.  Only the following remark is still valid
and already contradicts what I said earlier in the same post because if
VCross inside the class would modify the object, VCross outside the class
would be a different function, which it is not...

>>
Further, you define some functions in the class and then again outside, for
example VCross.

Also, I would strongly recommend to normalise vectors only when necessary.
sqrt is not only slow, but if you scale the vector a lot this way (you do so
for nearly every vector operation) the error will build up and might be
significant in the end.  At least you should make Update an inline function
to not waste more time on yet another function call.
<<

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

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