POV-Ray : Newsgroups : povray.off-topic : 99 lines of C++ for an unbiased ray tracer : Re: 99 lines of C++ for an unbiased ray tracer Server Time
4 Sep 2024 21:24:20 EDT (-0400)
  Re: 99 lines of C++ for an unbiased ray tracer  
From: Tim Cook
Date: 14 Jan 2010 08:37:28
Message: <4b4f1e18$1@news.povray.org>
scott wrote:
>> 53:  Vec nl=n.dot(r.d)<0?n:n*-1;
>>
>> different from "nl = -abs(n.dot(r.d))"?
> 
> a?b:c evaluates to b if a is true, or c otherwise.

LPC might be a little different, but can't you negate a variable by 
saying a=-a;?  Saves a little CPU cost.

--
Tim Cook
http://empyrean.freesitespace.net


Post a reply to this message

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