|
![](/i/fill.gif) |
This should be easy, but I'm having some trouble.
I would like to read a series of vectors <x,y,z> from a text file and plot the
points as spheres. To test things out, I made a text file with 2 vectors
separated by commas.
I get this error message. Can anyone tell me what I am doing wrong?
//-------------------------------------------
#fopen MyFile "myData.txt" read
# local i = 1;
#while (i<2)
#read (MyFile,Vector[i]
Parse Error: Expected 'undeclared identifier', empty array found instead
//---------------------------------------------
Here is the POV-Ray code I used:
#declare maxArray = 2;
#declare Vector = array[maxArray];
#fopen MyFile "myData.txt" read
# local i = 1;
#while (i<2)
#read (MyFile,Vector[i])
#local i = i + 1;
#end
#declare Graphic = union {
sphere {
Vector[i], 1 texture {
pigment { color rgb <1,0,0> }
finish { Substance }
}
}
sphere {
Vector[i], 1 texture {
pigment { color rgb <1,1,0 > }
finish { Substance }
}
}
} // end of Graphic
Post a reply to this message
|
![](/i/fill.gif) |