PDA

View Full Version : how to build 3D object?



nilratna
03-10-2004, 09:15 AM
I wont to build 3D object (eg car,chess board)using OpenGL.
Problem is that,I dont know any function or
method to build the object.
Please tell me,what kind of fuction or method
I must used to do this,Please give some example
sourse code.

infinitecmdz
03-10-2004, 09:22 AM
hi,

there are several ways for you to accomplish what you seek. you can specify each vertices in 3d space to create your model, or you can build your model in your favourite 3d package and use an exporter to get your .c code to get the vertices positions, normal vectors, texture co-or etc.

In anyway,if you're going for defining your own vertices in 3d space, i'd recommend you reading the red book which in invaluable.

Aeluned
03-10-2004, 09:47 AM
Yeah,
OpenGL doesn't have functions for generating a 3D model of anything.

I would go with cmdz's latter suggestion and build one using a 3D modeling app. Creating a 3D model of an object by specifying vertices to OpenGL would be an enormous task.

Get a little familiar with a 3D modeling package (ex: 3D Studio Max) if you aren't already so, then read up on parsing the particular format file (.3ds, whatever) and reading the vertices,tex coords, material colors etc from that file into your program.

good luck!

ppinter1
03-10-2004, 10:40 AM
If you are using Windows for development, try:

- AC3D (http://ac3d.org) for an excellent 3D modelling tool. Anim8or (http://anim8or.com) is also very good. Use these tools to create your models, and export them in 3DS format.

- Load the 3DS meshes you created above into a program like Display3DS (http://p-squared.com/Display3DS.php) to learn how it's done.

nexusone
03-10-2004, 01:12 PM
Simple objects can be written by hand in code, but complex objects(detailed)need to be done in a 3D modeling CAD program.

nehe.gamedev.net is a good place to start to learn the basics of openGL.

As for CAD, there is Blender(free), AutoCAD, 3D MAX, Maya, etc.
You create the objects with these type of programs then read them in to your openGL program.

03-11-2004, 06:55 AM
The problem with modellers such as 3DS MAX, Maya and AutoCAD is that they're extremely expensive.

Each costs about $3,000 to $5,000 for a licence, assuming you're not running a pirated copy. Even the student versions are $$$.

As for Blender, yes it's free, but the last time I checked the file format was undocumented and 3DS export wasn't available.

Maybe that's changed?