Click to See Complete Forum and Search --> : C++ and OBJ?
Emo
Mar 15th, 2001, 12:46 PM
Is it possible to add a OBJ (3D model) file into a C++ game?
HarryW
Mar 15th, 2001, 12:59 PM
It's possible to do pretty much anything if you know how. It might not be easy though.
I don't really know much about 3D graphics yet, but I think 3D data files basically hold info that you can get at with standard file access methods if you know how the format works. The standard way to do it with D3D, the way M$ want you to do it at least, is to use .x files. There are plenty of converters that convert .3DS files (from 3D Studio Max) to .x files. I don't know .OBJ files, but if they're common then there may be file conversion tools available.
You will need to load all the data into some kind of structure anyway, the popular way to do that at the moment seems to be to use a BSP tree. Don't ask me what a BSP tree is, I don't know, I just know that people use them for efficient culling in 3D scenes.
So err... in short, if you know the file format or can find a conversion tool to convert to a format you know, then you can use them, yes.
A file format is just that. A format that data is in. As long as you know what data is where inside of that file, you can load it into your program, and display it any way you like. Just becuase that program is written in a certain language doesnt mean you cant load it. So, yes, as long as you know how to load it, you can use .OBJ files in C++
Z.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.