Anim8or Community

General Category => General Anim8or Forum => Topic started by: atari_man_1983 on June 13, 2008, 12:45:10 am

Title: converting to code
Post by: atari_man_1983 on June 13, 2008, 12:45:10 am
Hey guys, im new to anim8or and 3d modeling in general, but im getting into it for game design and before i get too far Im hoping someone can tell me if it's possible to get the model output as c++; opengl code so I can put the code in myself. or if there a way to do it via other programs out there, i really don't want to spend the time to write it myself if theres already something outthere. ;D
Title: Re: converting to code
Post by: Claude on June 13, 2008, 01:12:36 am
You can export a static object as C code.(no animation)

There's a  C export function native to Anim8or. Menu: Object/Export.

Also , a C export script that you could tailor to your needs.See the script
page of the site.

On the Resources page of the site,you'll find a C header file,plus
an example of an OpenGl rendering program.
Title: Re: converting to code
Post by: atari_man_1983 on June 14, 2008, 03:49:41 am
not sure if thats what i want i need to find a way to export the model so i can put it into c++ code and render it myself. as in the for of triangle fans and efficient polygon arrays. don't see that right now in any of the export versions just a list of vertices normals and edges. any other ideas guys?
Title: Re: converting to code
Post by: texel on June 14, 2008, 06:29:50 pm
I have created a C++ .an8 file loader with a basic OpenGL example viewer (with full source code);

it do not use triangle fans or triangle strips because Anim8or do not store these informations in the .an8 files (triangles are isolated).
VBO are not optimized because Anim8or uses 1 vertex normal per vertex and 1 uv per vertex and i have not made a function to avoid  duplication of vertex which are not needed. In my viewer, Index buffer are not usefull, but you can use index buffer to use several material with only one vertex buffer for a mesh.

You must select "output normal" in the debug menu of Anim8or to have vertex normal exported in the .an8 file and loaded by LibAn8. LibAn8 can also compute face normals.