POV-Ray : Newsgroups : povray.windows : read problem in Win Vista : read problem in Win Vista Server Time
19 May 2024 13:21:54 EDT (-0400)
  read problem in Win Vista  
From: melo
Date: 15 Feb 2008 21:50:00
Message: <web.47b64f0d36bc6f2192254edf0@news.povray.org>
I have been trying to read from a file containing rotation vectors for joints
involved in a move, however I could not get it working.

I set up a while loop to read all the records in the file,  in the while
loop, POV-RAY reads the first record correctly, however in the second record it
complains about "Expecting a float, string, or a rotation vector, but finding a
instead."

I could not see anything different between 1st record it likes and the 2nd it
bumbs on, I even copied the 1st record twice to see if it will read it for the
seond time, it had not.

Again, here is my walk01.txt file:

"L_Hip_Ind",3,<-40,0,0>
"L_Knee_Ind",4,<0,0,0>
"L_Ankle_Ind",5,<50,0,0>
"R_Hip_Ind",13,<45, 0, 0>
"R_Knee_Ind",14,<5, 0, 0>
"L_Elbow_Ind",10,<2, 0, 0>
"R_Acromioclav_Ind",18,<0, 10, 0>
"L_Acromioclav_Ind",8,<0, -10, 0>
"R_Acromioclav_Ind",18,<-40, 0, 20>
"R_Elbow_Ind",20,<-90, 0, 0>
"R_Ball_Ind",17,<-60, 0, 0>
"Lower_Back_Ind",2,<-0,0,0>
"HumanoidRoot_Ind",0,<20, 0, 0>

Here is the loop that POV-RAY refuses to  use to read beyond 1st record:



         #fopen PosFile "walk01.txt" read
         #while (defined( PosFile ))
            #read (PosFile, Joint_Name, AVar_Ndx, Rot_Vector )
            #declare AVAR[1][AVar_Ndx] = Rot_Vector * clock;
            #debug concat( Joint_Name, ",", str(AVar_Ndx, 2, 0), ",",
                           vstr( 3, Rot_Vector, ", ", 3, 0), "\n" )
         #end
         #fclose PosFile

Any insight would be greatly appreciated, I attempted embedding blank spaces
among the three elements I am trying to read off of the file.  No matter what
combinations I had tried, I could not succeed.  I looked at the file with a hex
code encoder to make sure no funny invisible character was hiding.  Nope it was
not.  Carriage Return character was at the end of each line right after ">"
closing bracet of the Rot_Vector.

Thanks,
Meltem


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.