|
|
ingo <ing### [at] tagpovrayorg> wrote:
> from a stereo cam:
> #local D2_X_Fn = function(u,v){
> select(
> (u<=0), //u<0????
> -1,
> D1R_X_Fn((u/AspectU*image_width)-0.25,v),
> D1L_X_Fn((u/AspectU*image_width)+0.25,v)
> )
> };
>
> the alternative is select only smaller or bigger resulting in a pixel wide
> black line.
>
> So, what to do with the pixel in the middle? Another select with u=0?
Well, that's a pretty interestingly constructed select() function.
I would have done away with the Boolean operator and the semicolon.
I don't think the one you're using ever results in a <0 value for select() to
operate on, since the boolean operator only returns 0 or 1.
So just to keep myself sane during debugging, I'd write it like:
#local D2_X_Fn = function(u,v){
select (u,
D1L_X_Fn ((u/AspectU*image_width)+0.25,v)) // u < 0
D1R_X_Fn ((u/AspectU*image_width)-0.25,v)) // u >= 0
)
}
I guess if you wanted that one-pixel wide strip at the center to use the other
function, then you'd use the 4-argument version and repeat the first function
for the u = 0 case.
Hopefully at some point you can share some of your understanding of the
user-defined camera with a few simple explanatory examples / tutorials.
Post a reply to this message
|
|