Results 1 to 2 of 2

Thread: 3ds file loading

  1. #1
    Senior Member Regular Contributor
    Join Date
    Mar 2003
    Location
    Slovakia
    Posts
    108

    3ds file loading

    I'm trying to make a 3ds loader file but it seems to have difficulties dealing with chunk 0x4000 - it contains name of object.

    code
    FILE *file;
    unsigned char temp1;
    case 0x4000 :
    do
    {
    fread(&temp1,1,1,file);
    i++;
    }while(temp1!='\0');
    break;
    It doesn't recognise the \0 sign what wrong?

  2. #2
    Guest

    Re: 3ds file loading

    Well i use a ReadString function to do that when 0x4000 chunk is found, try it !

    Code :
    void ReadString(FILE *f,char name[255])
    {
       char c[2];
     
       c[1]='\0';
     
       while ( (c[0] = fgetc(f)) != EOF && c[0] != '\0') strcat(name,c);
    }
    taked in the Panard Vision 3ds loader.
    Hope that's help.

Similar Threads

  1. Loading BMP file using C++
    By Chayan Vinayak in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 07-29-2011, 11:07 AM
  2. Loading a 3ds file
    By freeze in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 11-07-2003, 06:38 PM
  3. Loading a File
    By Teddy in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 05-22-2003, 10:17 AM
  4. ASE file loading?????
    By Jon723 in forum OpenGL: Basic Coding
    Replies: 7
    Last Post: 08-21-2001, 06:49 AM
  5. TGA File Loading
    By VeRtEX in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 12-21-2000, 10:01 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean