I know there are quite a few text-to-array questions out there, but I am having a hard time matching those to mine.
I am not good at C++ but need to use it for my OpenGl programming.
Basically I have made an array of vec4's (vec4 is just 4 "points" for a coord system), and then I printed them out to a text file. The file reads like so (I eliminated the last point because it is ALWAYS 1 and I figured I could add it in when reading the text file later):
( 0.26, 0385, 0.48 )
( 0.27, 0386, 0.47 )
( 0.28, 0387, 0.46 )
( 0.29, 0388, 0.45 )
So every line is separated by one endl;
Now I want to read this text file and make it back into a vec4 array. Whats the easiest way to do this avoiding the '(', ',', and ')'? I could probably write huge long nested if/else to weed these unwanted characters out, but it would be quite inefficient and im sure someone out there has a smarter way.
Any suggestions? Help?
Thanks!