PDA

View Full Version : A simple opengl way to load objects(x, 3ds)?



Starnut coder
01-17-2001, 03:39 AM
[QUOTE]
Well i used to program directx, now then i used *.x files as models which i built in 3d studio max r3.
But does anybody know a simple way to load and display an x or 3ds file.
Does opengl maybe also have a meshbuilder?

Thnaks for any help
-your starnut coder

SuperFly
01-17-2001, 10:55 AM
OpenGL doesn't have any high level stuff like the old DirectX Retained Mode. Your best bet is to get a program called 3D Exploration and use it to export a model to OpenGL .cpp files. This usually works pretty good, but remember to select Tools|Convert To Double Sided.

mike j
01-17-2001, 08:47 PM
export your objects to .ASE and parse the
data into your program

Starnut coder
01-18-2001, 12:06 AM
Thanks that works fine i got the program View3ds its great.

billy
01-18-2001, 12:12 AM
I usually use my own translator to convert STL files to OpenGL code. The only problem is that STL files do not have information about color, animation, etc. They just have the triangulated mesh. Then I have to assign those variables when I am programming. Too bad OpenGL does not have a MeshBuilder like DirectX... http://www.opengl.org/discussion_boards/ubb/frown.gif

mcbastian
01-19-2001, 02:24 AM
opengl is no high-level api. it's a low level api for doing the graphic and render stuff. the rest you have to do yourself http://www.opengl.org/discussion_boards/ubb/smile.gif

greetings,

Bastian.

frog
01-20-2001, 12:01 AM
If you want to render an *ase file, the simplest way is to build in your program four structures:
for exemple:

typedef struct {
float x,y,z;
} VERTEX;

typedef struct {
int A,B,C;
}FACE;

typedef struct{
int nvert;
VERTEX *point;
} OBJECT;

typedef struct{
int nobj;
OBJECT *object;
} SCENE;

after having declared these, read your ase file with the fonction strcmp and load each object,coordinate, face in yours structures... hope my help,
frog

Starnut coder
01-20-2001, 01:55 AM
Thanks i got objects in now.
Thanks for all youre help guys.

alsanico
01-24-2001, 10:02 AM
Could you please tell me where you found View3ds?
Thanks a lot

Alex

Starnut coder
01-24-2001, 06:35 PM
Sure i can send the program to you just mail me your email. Thanks