PDA

View Full Version : 3D models: free source code (OpenGL/GLUT)?



torbjorn
09-25-2002, 10:28 PM
Hi!

I am looking for some free 3D-models written in OpenGL/GLUT. I would like some industrial objects like pumps, tanks, valves, thermometers, level-indicators, speedometers, fans an so on.

Do you know of any code libraries with free sourcecode for such 3D-models?

-Written in OpenGL/GLUT, of course (not 3ds files).

Thanks!

Best regards,
Torbjørn

Allan Walton
09-25-2002, 11:46 PM
i'm presuming you want the opengl C / C++ code for whatever model?

if that's the case create a model of what you want yourself and use a program like 3d exploration to convert then to the code - it outputs display lists i think...

Allan

torbjorn
09-26-2002, 01:01 AM
Yes, I'd like C/C++ code, that's right.

Do you mean that I should build my models myself using 3DStudio Max or other program, and then generate source code?

Or should I download existing models and generate code from them? If yes to this - do you know of a nice library of models?

Thanks again :-)

Best regards,
Torbjørn

nexusone
09-26-2002, 05:14 AM
Sorry, but I don't think you will find a library of premade opengl or glut objects.

Maybe you could be the first person to do it! http://www.opengl.org/discussion_boards/ubb/smile.gif

What most people do is to get the source code for model loading routine and just load it in without having to convert the model. There are lot's of tutors on loading 3DS, OBJ, and other formats.

There is a program that will convert most object formats into other formats, supports converting the object into a C file in the form of vertex data. But you would still have to write a routine to take that vertex data and make the object.



Originally posted by torbjorn:
Hi!

I am looking for some free 3D-models written in OpenGL/GLUT. I would like some industrial objects like pumps, tanks, valves, thermometers, level-indicators, speedometers, fans an so on.

Do you know of any code libraries with free sourcecode for such 3D-models?

-Written in OpenGL/GLUT, of course (not 3ds files).

Thanks!

Best regards,
Torbjørn

Leyder Dylan
09-26-2002, 07:19 AM
Am I wrong, but I remember 3DExporter ???

jubei_GL
09-26-2002, 11:14 AM
well, If I get my Ass moving, I might create a small MFC program, that will allow you to load 3DS object/s and save vertices/faces as bunch of data in regular .txt file .. You can later just read each #, 1-by-1 and put into array, and than display it .......

The question is WHEN WILL I MOVE MY AZZ TO DO IT . ? .

torbjorn
09-26-2002, 08:58 PM
Thanks for valuable input, folks :-)

My challenge is that I need to dynamically change the shape of some of the objects (not all).

One example is that I would like to show a temperature bar with changing temperature..

But I guess I could use static models and draw some additional OpenGL-kode on top of them?

Torbjørn

jubei_GL
09-27-2002, 06:00 AM
well to do that, you will need to load 3D objects with animation ..

Allan Walton
09-27-2002, 06:16 AM
Depends on how you have to change them really - do you mean change the scale, orientation and position? or get a model to perform an action such as walking?

the thermometer example could be done by creating / using a model with a hollow cylindrical centre and using GL to generate a cyclinder model yourself - position them correctly and you could create the effect of the temperature getting hotter.

if it's the second option i'd suggest using MD3 files - there quick and easy to get going and have built in animations for walking and such like

cheers

Allan

nexusone
09-27-2002, 06:44 AM
You can build those simple objects with glu/glut primitives.

Best way to start is with a piece of graph paper, draw out the object you want and what primitives would be needed to make it.

example:

// temperature bar.

glPushMatrix();
load_texture_with_temp_scale_marks();
Draw_quad_in_the_shape_of a rectangle();// place to put our temp scale image.

glColor3f(1.0, 0.0, 0.0); //The color red
gluCylinder( c_obj, 1, 1, hight_of_cylinder, 8,8);// Adjust hight of cylinder to relate to tem change.
glPopMatrix();

Easy euh?

http://www.opengl.org/discussion_boards/ubb/smile.gif


Originally posted by torbjorn:
Thanks for valuable input, folks :-)

My challenge is that I need to dynamically change the shape of some of the objects (not all).

One example is that I would like to show a temperature bar with changing temperature..

But I guess I could use static models and draw some additional OpenGL-kode on top of them?

Torbjørn

torbjorn
10-02-2002, 09:08 PM
Thanks, guys!

I've been away for some days now, but I'll start making models now!

Thanks again :-)

Torbjørn