Loading files

Started by
0 comments, last by The Kid 22 years, 12 months ago
Could anyone point me in the direction of some good tutorials or source code on loading of text files and such to use as a map ? Just a simple list of vertices or anything like that. I know one of Nehe''s tutorials has something like that in it, but thats not the only feature in the tutorial, and sometimes it gets hard to distinguish what part of the code is for what, even with comments. Or maybe its just me being stupid. I''m also interested in why it works, as well as how to make it work. Thanks in advance. The Kid I don''''t know what the future holds, but I know who holds the future.
I don''t know what the future holds, but I know who holds the future.
Advertisement
Hi,

This site has loads of good source to look at:

http://romka.demonews.com/opengl/demos/other_eng.htm

What you are trying to do is fairly easy to start with. First, just work out how you want to store your model data. (I assume when you said map, you mean model?)
If you were being simple, you might just want to have an array of vertices and an array of faces...

open a file - look in any c/c++ book on how to do file i/o
read numbers out of the file into your arrays
close file
write a function to draw what is in your arrays.

You can make this more complicated without too much trouble :-) At that point, you might want to start looking at existing model file formats.

Any more questions or if I missed your point, ask away...

Regards,
DeVore
Hello,

This is kinda like a qustion I have. dose anyone know any demos or explanitions of how to read a settings type file. I know how to open the file and read it but I need info on reading the lexocan, I am trying to ues a balansed tree to tead in the string then do a recsive state mechean type thing to see if it is a commnd or value to controle statment... ect. any help would be uesfull thanks.
Hello,

This is kinda like a qustion I have. dose anyone know any demos or explanitions of how to read a settings type file. I know how to open the file and read it but I need info on reading the lexocan, I am trying to ues a balansed tree to tead in the string then do a recsive state mechean type thing to see if it is a commnd or value to controle statment... ect. any help would be uesfull thanks.

This topic is closed to new replies.

Advertisement