|
|
>> 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++.
It is surprising to me that this actually works. I was under the
impression that C does not actually distinguish between pointers and
arrays (and integers and booleans and...)
>> 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?
No, I misread the code. It's actually deciding whether to negate n based
on a function of n, not n itself.
>> 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.
No, it's an argument in the radiance() function, I meant where is it
defined in main().
> 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.
Yeah, I tried that too...
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
|