|
|
> #declare Earth_Slice=
> mesh2
> {
> vertex_vectors
> {
> xdim*ydim
> #declare row=0;
> #while (row<ydim)
> #declare col=0;
> #while (col<xdim)
> #declare clrvect=eval_pigment(map, <1/(xdim*2)+col/xdim,
> 1-(1/(ydim*2)+row/ydim), 1>);
> // #warning concat("<",vstr(3, clrvect, ",",7,2),">")
> // #warning concat(str(col,2,0)," ",str(row,2,0))
> #declare hval=clrvect.red*65280+clrvect.green*255;
> #declare hval=-deadsea+rng/65535*hval;
> // #warning str(hval, 1, 2)
>
> (rd+hval)*<sin(radians(-longstart-col/xdim))*cos(radians(latstart-row/ydim)),
>
> sin(radians(latstart-row/ydim)),
> cos(radians(-longstart-col/xdim))*cos(radians(latstart-row/ydim))>*sf
I would put something very simple like this for debug purposes:
<row,col,hval>
...
> face_indices
> {
> (xdim-1)*(ydim-1)*2
> #declare r=0;
> #while (r<ydim-1)
> #declare c=0;
> #while (c<xdim-1)
> <r*xdim+c, r*xdim+c+1, (r+1)*xdim+c>,
> <r*xdim+c+1, (r+1)*xdim+c+1, (r+1)*xdim+c>
That looks fine to me.
Put your camera in a suitable location for the above debug mesh to show
up, and put a constant coloured background so that you can see the
difference between shadowed areas and areas not rendered properly.
Assuming the above test works then I would gradually build back up to
your equations (maybe first changing the scale to match, then
introducing the trig) to see what causes the problems.
My guess is accuracy because you are dealing with a huge dynamic range
of dimensions.
Post a reply to this message
|
|