Results 1 to 4 of 4

Thread: Max files, Help I almost got it.

  1. #1
    Member Contributor
    Join Date
    Apr 2000
    Staten Island New York

    Max files, Help I almost got it.

    So far I have downloaded Explorer 3D, saved
    a test 3DMax file to .ASC and have also saved it as .cpp in Explorer3D.
    I have read up on opening files in C with fopen, etc. Okay, so I see how I could just incorperate the .cpp file into a GLUT program
    I've written, but don't understand how to open a .ASE file in an OpenGL program. Do you have to edit the file, since I'm using the console window for feedback I keep on getting my error message Can't find file, which means the filePtr is NULL. Any advice or another clue would be appreciated. Any simple by the hand examples showing how to open and ascii file to a glut window would be great.

  2. #2
    Junior Member Newbie
    Join Date
    May 2000
    Coon Rapids, MN, USA

    Re: Max files, Help I almost got it.

    Well Robert, I'm not familiar with the ASE format (is it any good?), but I do have several programs that read in 3D objects from POV (.inc) files, which are ASCII.

    There are two issues you must make sure you have right before you can start reading a file:

    1. The file must be in the right place. This basically means that you either give the correct pathname to fopen, or have the file sitting in the program directory. As pathnames differ significantly from one platform to another, I prefer to have the file in the working directory. In VC++, this means it must be sitting in the same folder as the .dsw project file, and not the debug folder.

    2. Then, you must make sure you are passing a string to fopen which totaly matches the actual filename. Keep in mind that windows hides extensions in the explorer, but you will still need to have the extension when you call fopen. So, for example, if you had a file (thats my 3D I read), explorer would simply show it as 747 but when you call fopen you must pass it the string Oh, btw, the file must be readable ascii, and the string you pass to fopen must be terminated by an endline (I think... might not be the case).

    I hope that helps you out! Good luck writing the parser to read the thing, its been my experience that writing parser to read 3D objects can be more challenging than writing the OpenGL to display them!! Another bit of advice is to use the strtok and strtod family of commands, I found them very handy.

    [This message has been edited by Cyrius (edited 05-22-2000).]
    -- Cyrius Tor
    "Wherever you go, there you are"

  3. #3
    Senior Member Frequent Contributor
    Join Date
    Feb 2000

    Re: Max files, Help I almost got it.

    Hi !

    You might run into a problem I have everytime....
    Let's say you want to access the file "D:\models\toto.ase".
    You should write in your code :

    FILE *in=fopen("D:\\models\\toto.ase","rb");

    The backslash is a special token when used inside a string in C/C++. To make the compiler understand that it is indeed a backslash, you have to double it... (I forget this almost every time I use a path in one of my programs !).

    I am not sure if this is your problem : perhaps you are less dumb than I am !

    Concerning the other question : yes, ASE files are really good except that you can only export one frame at a time (bye bye animated meshes !).

    Hope I helped you !



  4. #4
    Senior Member Regular Contributor
    Join Date
    Feb 2000
    milano, italy

    Re: Max files, Help I almost got it.

    everything is right.
    personally i use to specify files directories with the slash / symbol, because msvc understands it the same, and is less prone to errors.
    not a strictly opengl issue, but can be annoying sometime


Similar Threads

  1. Replies: 2
    Last Post: 10-20-2007, 02:15 PM
  2. nvb files
    By imported_robert in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 03-14-2003, 02:34 AM
  3. DEM Files
    By Pete Bassett in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 11-09-2000, 03:50 AM
  4. open Gl 1.2 header files and lib files for Windows 2000
    By nes in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 10-20-2000, 09:55 PM
  5. open Gl 1.2 header files and lib files for Windows 2000
    By nes in forum OpenGL: Advanced Coding
    Replies: 0
    Last Post: 10-20-2000, 10:57 AM

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