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

Starnut coder
01-17-2001, 02:39 AM
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

01-17-2001, 09: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, 07:47 PM
export your objects to .ASE and parse the
data into your program

Starnut coder
01-17-2001, 11:06 PM
Thanks that works fine i got the program View3ds its great.

01-17-2001, 11:12 PM
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

01-19-2001, 01: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



01-19-2001, 11:01 PM
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;

typedef struct {
int A,B,C;

typedef struct{
int nvert;
VERTEX *point;

typedef struct{
int nobj;
OBJECT *object;

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

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

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


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