importing 3d
flosy1234

I understand that allefro.cc has thae abilety to suport 3d games but does aneone know if you can inport 3d object files sutch as .3ds files and so on I couldent find any info on it sorry if this is a stupid question.

Albin Engström

It's not really a stupid question, but it's horribly written(since you want to program maybe you should try to write properly or at least try(like I'm doing ^^)).

And loading "3d objects" is all about knowing or be able to handle the file format. and i know i shouldn't answer this question since i don't really have much of a clue but no, there is no function within allegro that allows you to import 3ds files. Find out how to make such an function or use an already written one.

One more thing, if you're into 3d, pure allegro is not what you want.
Try out AllegroGL. :)

Paul whoknows
Quote:

I understand that allefro.cc has thablablablablabla

Allefro, the perfect name for the allegro mascot!

gnolam
Quote:

Allefro, the perfect name for the allegro mascot!


allefro.png ?

kronoman

to load a 3D model you will need to
a) find already done code to load it (i.e a engine such as Ogre provides this)
b) code yourself the loader, I have found that .obj files are the easier to load (for me)

Allegro does not provide model loading functionality.

Elverion

But obj provides no animation, correct? Which means you'd need a separate obj file for each frame of the animation, which would waste a lot of space and resources.

Paul whoknows
Quote:

But obj provides no animation, correct? Which means you'd need a separate obj file for each frame of the animation, which would waste a lot of space and resources.

I think things don't work like that. I know nothing about 3d game programming, but I can imagine that the animation is done moving the object's vertices/vertexes using keyframes to interpolate them. I could be mistaken of course.

GullRaDriel

Way off-topic, but gnolam's post have just made my day ! :D

monkeyCode

MD2 is nice and simple, no bones :D

LennyLen
Quote:

since you want to program maybe you should try to write properly or at least try(like I'm doing ^^)

Maybe if you try a little harder, you'll hit the shift key every time you press the "I" key. :P

GameCreator
Quote:

find already done code to load it (i.e a engine such as Ogre provides this)

I would highly suggest Irrlicht

Matt Smith

The reason that there are no Allegro-specific importers is because Allegro does not have internal data representations for meshes. It is too low-level for that. Any importer needs to be customised to the in-memory format.

I have my own internal format, and code to render this to both Allegro software 3d and OpenGL, but it isn't flexible enough (yet) to be considered a universal solution. For example, at the moment I use arrays of V3D_f to store vertices, which were designed for Allegro's old (and nearly deprecated) 3d routines, and contain c,u&v values for each vertex. This is not ideal for most models, which have the u,v values stored for each vertex in a face, not once for each vertex in the mesh.

My plan is to expand my current MESH types from the following

typedef struct MESH_TYPE {
   int flags;
   int n_verts;  VERTEX_TYPE * verts;
   int n_edges;  EDGE_TYPE * edges;
   int n_tris;  FACE_TYPE * tris;
  
} MESH_TYPE;

and replace them with a universal type

typedef struct MESH_TYPE {
   int flags;
   MESH_VTABLE * vtable;   
   int n_verts;  void * verts;
   int n_edges;  void * edges;
   int n_faces;  void * faces;
  
} MESH_TYPE;

which can be used as the in-memory format for nearly all uses. If this catches on, it could make it possible to develop universal importers, that do not tie you to external engines like Ogre, irrlicht, etc.

Jonny Cook
Quote:

Maybe if you try a little harder, you'll hit the shift key every time you press the "I" key. :P

That doesn't seem rIght...

Albin Engström
LennyLen said:

Maybe if you try a little harder, you'll hit the shift key every time you press the "I" key. :P

I don't get it... ??? :P

gnolam
Quote:

And loading "3d objects" is all about knowing or be able to handle the file format. and i know i shouldn't answer this question since i don't really have much of a clue but no, there is no function within allegro that allows you to import 3ds files.

Albin Engström

ah...

Archon
Quote:

I understand that allefro.cc has thae abilety to suport 3d games

Allegro itself? Don't use its current 3D routines. Use AllegroGL instead.

Quote:

does aneone know if you can inport 3d object files sutch as .3ds files and so on

You can inport simply by loading a file with the stdio library, then read the metadata, then read the vertex/normal/texture information and store it in memory for OpenGL to use.

Thread #592452. Printed from Allegro.cc