GL_Export for 3Ds Max users..

by Kapil Bedarkar
2:43 PM October 04, 2002
    Contents
  1. What is GL_Export
  2. How to use
  3. Check List
  4. Limitations
  5. Demo

What is GL_Export

GL_Export is Smart Utillity for OpenGL developers who know 3Ds Max and want to use 3Ds Max as 3D-Model designer for OpenGL Project. GL_Export does just that It takes a Max file and writes a OpenGL code for you. But you have to export *.max file to *.ase file, this max inbuild utillity.

How to Convert Max file to OpenGL code file

GL_Export give output as C Header file you can then include it any openGL project.

  1. Open Max Scene which you have to export Go through Check List provieded in this document. Export file in ASE file format ( ASE not ASC )

  2. Open GL_Export utillity ( you have to compile given code to generate Application )

  3. Import file which you exported form 3Ds Max.

  4. Now take while clicking tree and it's sub items for check, Did you find all your objects that was created in max, all materials and also please check UVW co-ordinates if they are absent then you probably find you object Black rendered in your OpenGL Scene.

  5. Now If you are happy then click export. You will prompt for Save file name ( C Header file ) so give name and contine. If you ASE file is Big enough then please wait a while.

  6. Include this file in your project and don't forget to call functions created by this file

Check List ( Before you use GL_Export )

Some points you should remember

  1. Check Every object in scene has unic name and is starting with alpha.

  2. Check Materials also that each have name starting with alpha and also a unic one.

  3. Check Each Material has Diffuce Color Map ( You Must you Diffuse color Map because GL_Export is designed only for TextureMapping ).

  4. Render Diffuse Maps by Running Script I had provieded or do it on you own. Plese note to put these render images in TextureMaps directory in your Project. ( I you don't get this follow demo given in this document )

Limitations of GL_Export

  1. I am using a function CreateTexture(UINT textureArray[], LPSTR strFileName, int textureID) which is not defined in this Export file if you don't have that module you have to use it from demo I had provied this function is downloaded from GameTutorials.com.

  2. Demo is limitated for *.Bmp as texturemaps still you can add Moduls of you own and enhance GL_Exports abillityes all changes are well come and please do publish it at FlipCode.com

  3. You should use standard materials for Objects As GL_Export is not designed for other material parameters such as specular level or reflection. But you can use Multi/Sub-object as it is created atomatically when you use different materials for different faces

  4. Avoid more than one Level of Multi/Sub-Objects. One Sublevel is No problem consider this:

    Avoid this

    Do this

    THis is because if you use simillar Material Multiple declearations in OpenGL code will occure and will create a warning even error.

  5. As this is my first ever project so please do understand some truble and have a hart.

  6. I you have any suggestions please contact at Kapil_Prashant_Ayam@rediff.com

A Demo how to Bring 3Ds Model in OpenGL Scene.

    Now Please read instructions carefully and follow it. it must work.
  1. Open Max create your 3D Model ( Draw a TeaPot ).

  2. We will keep Objects name as it is ( Teapot01 ) And will have Parameters as

    • Radius : 50
    • Segments : 4

  3. Now Open Material Editior Select very first Material and change it's name to 'TepotShader' now give it your favourite diffuse color map and assigne to TeaPot01

  4. Now Let Give some UVW map I select mapping as box

  5. Open Max Script which I had provied RenderMaps.ms. Running this script will render all diffuse color maps used by materials and output will a Bitmap file at 'c:' move these files to 'BlankProject\texuremaps'

  6. Now Export File in ASE file Format

  7. In ASCII export dlg check that following boxes are checked

    • Mesh Definations
    • Materials
    • Mesh Normals
    • Mapping coordinates
    • And Geometric

  8. Now Run GL_Export ( I you had not complied code yet please complie it to generate Application )

  9. Open the ASE file you created and take a look at the tree

    Did you find your teapot?

  10. Now Click Export and give header file name teapot Please do select destination directory as 'BlankProject/' Provieded in Zip file

  11. GL_Export work is over now Open provied demo project by selecting 'BlankProject/texturing.dsw'

  12. Add new created C Header file to Header files tree

  13. Take a while to see this header file

  14. Open Main.cpp

  15. and include your Header file by #include

  16. Add Line CreateMaterialLib() in Init() function.

  17. Also add CreateTeapot01(); line here.

  18. Now add Line glCallList( TEAPOT01 ); in RenderScene() between glPushMatrix() and glPopMatrix().

  19. Now Build and Execute.

    
    
    
    
    
    
    
    Kapil Bedarkar,
    N.D.M.V.P. COE,
    Nasik