Mail Archives: djgpp/1997/07/01/02:34:35
Ben Cohee wrote:
>
> Hello I am new to DJGPP and am using Allegro for all my graphic routines
> for now because of the change in regular dos mode to protected mode. I
> need to read in a file which is my 3d coordinates for an object which has a
> very simple format. My other reader wouldnt work in DJGPP. I guess the
> file could also be used as a binary file with the Allegro packfiles since
> its just an ascii file. This is the format :
> 4 1
> 10 10 10 /* the 4 */
> 10 -10 10 /* is the number */
> -10 10 10 /* of lines here which always */
> -10 -10 10 /* consist of 3 numbers */
> 4 0 1 2 3 /* the 1 is the number of these lines */
> /* which is the number of points in the polygon [4] */
> /* and the number of points[4] after it [0 1 2 3] */
1) I don't get the part with "the 1 is the number of these lines which
is the number of points in the polygon [4] and the number of points[4]
after it [0 1 2 3] " at all! whadda ya mean?
2) about reading files:
you declare a file pointer: FILE *fp;
you open the file for reading: fp=fopen("model.plg","r");
you read from it with fscanf (use fscanf exactely like scanf but the
first argument will be the file pointer):
fscanf(fp,"%d",&Integer);
> Thanx in advance.
--
--> http://www.cam.org/~tudor <--
prick your finger it is done
the moon has now eclipsed the sun
the angel has spread it's wings
the time has come for bitter things
- Raw text -