|
|
And lo on Thu, 24 Jun 2004 15:46:27 +0100, Phil Cook
<phi### [at] nospamdeckingdealscouk> did spake, saying:
> <fab### [at] icunicampbr> did spake, saying:
>
Checking against the picture you linked to, my code seems to produce a
upside-down mirror of your image. Use this instead:
//start code
#fopen MyFile "superficie.dat" read
#while (defined(MyFile))
#read (MyFile,LastX, LastZ, DitchY)
#end
#declare LastX=LastX+1;
#declare LastZ=LastZ+1;
camera{
location <-LastX/2,300,-300>
look_at <-LastX/2,0,-LastZ/2>
}
light_source{<-LastX/2,50,-LastZ/2> rgb 1 shadowless}
#declare MyArray= array[LastX][LastZ];
#fopen MyFile "superficie.dat" read
#while (defined(MyFile))
#read (MyFile,MyX, MyZ, MyY)
#declare MyArray[MyX][MyZ]=MyY;
#end
#declare i=0;
#declare j=0;
#while(i<LastX)
#while(j<LastZ)
box{0,<-1,MyArray[i][j],-1> translate <-i,0,-j> pigment{green 1}
finish{ambient 0.5}}
#declare j=j+1;
#end
#declare i=i+1;
#declare j=0;
#end
//end code
I'm not sure why you appear to have a negative X & Z compared to the data
but this should match your image.
Use whichever you want, switch the MyX, MyY, MyZ variables to suit.
--
Phil Cook
--
All thoughts and comments are my own unless otherwise stated and I am
happy to be proven wrong.
Post a reply to this message
|
|