|
This thread is locked; no one can reply to it. |
1
2
|
How can I load 3d models? |
tommy tinpo
Member #4,827
July 2004
|
I don't know how can I load 3d models, and if I can make them whith a specific program such as: 3d studio etc.... tnx a lot at all! |
X-G
Member #856
December 2000
|
Find file format somewhere. Read it and parse into your mesh structure. Where is the problem here? You need to ask a more specific question. -- |
23yrold3yrold
Member #1,134
March 2001
|
Right. Just create the data structure to load the data into, then load the file into it, and you're done. -- |
gnolam
Member #2,030
March 2002
|
I agree with Secretary of State X-G. Anyway, for a file format to implement I suggest the Wavefront OBJ format - it's an ASCII format, and about as simple as a 3d model format can be (at least if you ignore the NURBS stuff). And as a bonus, most decent modelers can export to .obj so you won't have to write your own converters. -- |
Thomas Harte
Member #33
April 2000
|
Grrrr, and I wasted my life on a 3ds importer! [My site] [Tetrominoes] |
tommy tinpo
Member #4,827
July 2004
|
I understand what you say, but now, can you suggest me some tutorials of allegro opengl or something about 3d programming with allegro? |
FMC
Member #4,431
March 2004
|
tutorials about OpenGL: NEHE also have a look at the redbook(programming guide for opengl) and at the bluebook(reference for opengl) [FMC Studios] - [Caries Field] - [Ctris] - [Pman] - [Chess for allegroites] |
tommy tinpo
Member #4,827
July 2004
|
Somebody can suggest me a program to convert 3d models into file to parse into mesh structure. thanks a lot at all! |
X-G
Member #856
December 2000
|
3D models ARE files you can parse into a mesh structure. What do you need? -- |
FMC
Member #4,431
March 2004
|
Game Tutorials scroll down the page, you will find tutorials on how to load some 3d models format in your prog [FMC Studios] - [Caries Field] - [Ctris] - [Pman] - [Chess for allegroites] |
tommy tinpo
Member #4,827
July 2004
|
I have another problem... I have a 3d model with 2 animations, how can I use the animations of the model?:P |
X-G
Member #856
December 2000
|
Load both and display them at the appropriate time, of course. Ask more specific questions, damn it. -- |
tommy tinpo
Member #4,827
July 2004
|
Mithrandir I have sent you a private message! |
Rampage
Member #3,035
December 2002
|
Quote: Mithrandir I have sent you a private message! Ah, the irony... -R |
Archon
Member #4,195
January 2004
|
Ive been trying to load 3D models but I just use someone elses . But the code to load a MD2 format (or MDL or MD3) are like 5 pages long :-\ |
deps
Member #3,858
September 2003
|
Archon
Member #4,195
January 2004
|
I WOULD but, I like stuff to be easy but with control. Thats why I wanna dissect the MD2 Loader and make it a header that I can use in any AllegroGL project... Instead of full on DirectX |
pantz
Member #3,387
March 2003
|
MD2 is actually a pretty easy format to load and display. The downside is that it's pretty aged and still uses frames and not a skeletal animation system. I hacked up a small MD2 loader last weekend for my game, to see how hard it actually is to load/display them. (see attached file) It uses C++, Allegro and AllegroGL, and it's not 5 pages long It could be even shorter by using a single fread to load the data. Anyway, maybe it gets you started. Some things to note: - the animation is a bit bumpy, that's because only the key frames are displayed, there is no interpolation done - it's my first try at MD2 and 3d models in general, so it's not perfect |
Archon
Member #4,195
January 2004
|
Hmm, I envy your ability to learn something Im TRYING to learn pantz. I downloaded your MD2 example but I am having problems with Allegro.h for some reason... Never done this before --------- EDIT ----------- --------- UPDATE ------------ |
pantz
Member #3,387
March 2003
|
Do you have vsync on? I get like 1400fps without vsync. To get smooth movement you have to interpolate between the current frame and the next frame. That means computing the vertices of the triangles on your own, depending on the display duration between the single keyframes. |
Archon
Member #4,195
January 2004
|
You didnt do that? And NFI whether I do :-\ --------- EDIT --------- --------- EDIT 2 --------- |
pantz
Member #3,387
March 2003
|
I didn't implement it because it was just a test and my game will only need few (if any at all) animations, it's a space shooter But it shouldn't be that hard to implement it. I think all you have to do is to get the difference between each current vertex and the next vertex, divide this distance by the number of steps (smoothness) and add this number to the current vertex position. steps = 10 for x, y and z. Maybe it's easier to use vectors though. |
Archon
Member #4,195
January 2004
|
Its all making sense now!!! But since I havent read all of MD2.cpp, which function would that go in? -------- EDIT -------- |
Tobias Dammers
Member #2,604
August 2002
|
No, some do also feature NURBS and other mathematical surfaces that can either be passed to the GL or transformed into poly's at run-time. --- |
Archon
Member #4,195
January 2004
|
I think I mightve hijacked the thread... tommy tinpo: Did you try out pantz's MD2 (Quake 2 Models) loader? |
|
1
2
|