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 23:20:04 EDT (-0400)
  Re: 99 lines of C++ for an unbiased ray tracer  
From: Darren New
Date: 14 Jan 2010 12:50:08
Message: <4b4f5950$1@news.povray.org>
Invisible wrote:
> 44:  double n=sizeof(spheres)/sizeof(Sphere);
> 
> Well... that's... one way to figure out how big an array is. :-.

That's the usual way to figure out how big an array is in C and C++.

> Evidently my C++ is weak, but... how is
> 53:  Vec nl=n.dot(r.d)<0?n:n*-1;
> different from "nl = -abs(n.dot(r.d))"?

In the lack of needing to define the abs() function?

> Also, where THE HELL is "Xi" defined? I can see it *used* in several 
> places, but I can't find a definitions.

Line 48. It's an argument to the function. Note that text search will 
usually answer that sort of question on a C program, and often on a C++ 
program too.

Not always, mind, but usually.


> Line 79 means each row of pixels is computed in parallel, right?

Got me. It looks like someone is asking the compiler to do that if it can.

-- 
Darren New, San Diego CA, USA (PST)
   Forget "focus follows mouse." When do
   I get "focus follows gaze"?


Post a reply to this message

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