Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

An update to Anim8or, v1.00b, is available with a few bug fixes. Get your copy HERE. See the "ReadMe" file for details.

Author Topic: converting to code  (Read 2262 times)

atari_man_1983

  • Newbie
  • *
  • Posts: 2
    • View Profile
converting to code
« 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
Logged

Claude

  • Full Member
  • ***
  • Posts: 244
    • View Profile
Re: converting to code
« Reply #1 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.
Logged

atari_man_1983

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: converting to code
« Reply #2 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?
Logged

texel

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
Re: converting to code
« Reply #3 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);
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