Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

Ian Ross has just released a book on Anim8or. It's perect for a beginner and a good reference for experienced users. It contains detailed chapters on every aspect, with many examples. Get your own copy here: "Anim8or Tutorial Book"

Author Topic: converting to code  (Read 6844 times)

atari_man_1983

  • Newbie
  • *
  • Posts: 2
    • View Profile
converting to code
« on: June 12, 2008, 08:45:10 pm »

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
Logged

Claude

  • Sr. Member
  • ****
  • Posts: 285
    • View Profile
Re: converting to code
« Reply #1 on: June 12, 2008, 09:12:36 pm »

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.
Logged

atari_man_1983

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: converting to code
« Reply #2 on: June 13, 2008, 11:49:41 pm »

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?
Logged

texel

  • Jr. Member
  • **
  • Posts: 81
    • View Profile
Re: converting to code
« Reply #3 on: June 14, 2008, 02:29:50 pm »

I have created a C++ .an8 file loader with a basic OpenGL example viewer (with full source code);
http://texel3d.free.fr/projets/liban8/index.html

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.




Logged