Plane in OpenGL

Started by
2 comments, last by V-man 14 years, 2 months ago
Hi, Does anybody have any suggestions on how to create an airplane model in OpenGL (or have an example of a simple one)? I need to make the plane circle around but I just can't seem to create the plane model. I have tried gluCylinder, but couldn't get that to work. Thanks!
Advertisement
It's going to be hard to make a plane using gluCylinder, you'd need to at minimum add some more calls to draw triangles for the wings and tail, as well as something for the nose. Even then it would look pretty bad.

Probably your best bet is to use a modeling program to build the model (I used to use Wings3D for aircraft) and then export and load the model into your program. If you don't want (or have time, or the ability) to write code to load the model from a file, you can always export to a human readable format like .obj and then manually add the render calls to draw the triangles in the .obj file to get it working. If you are going to have more than just the one plane model, though, writing an importer would be really helpful in saving you a ton of time in the long run.
Is this for a homework assignment of some sort? If the purpose of the model is simply functional (rather than to 'look good'), you should be able to render it programmatically using, say, a cylinder and three triangles (two for the wings, one for the tail fin).

You said you 'couldn't get gluCylinder() to work'. Given that information, the best response I can come up with is, 'Write your code differently' :) If you need better help than that, you'll need to show what you've tried, and explain in what way it didn't work.
Have classes started? Are we in January?
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

This topic is closed to new replies.

Advertisement