creating 3d aeroplane

can anyone show me how to create a 3d aeroplane using opengl ? i understand that we need to plot the vertices but i just don't get the concept of combining all parts of aeroplane...can somebody show me the codes of creating a 3d aeroplane ? thanks..
LVL 1
nwhanAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

InteractiveMindCommented:
Have you loaded a mesh of the plane from a file (such as .3ds, or something) ?
0
InteractiveMindCommented:
You usually loads all of the surfaces and properties of the model (from a mesh file), and for each surface, you render them to the scene..
0
nwhanAuthor Commented:
thanks for replying man...
but im a real real beginner in opengl..
do u have a sample code of aeroplane? or reference with codes from the website...i couldn't really find...thanks
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

InteractiveMindCommented:
Well, an aeroplane is hardly a simple model. So hardcoding all of the surfaces for a decent-looking plane isn't highly realistic.

You could give this code a go:
www.uku.fi/~tronkko/airplane_gl.c

I'm not sure what the quality of the plane will be like mind you.
0
nwhanAuthor Commented:
can i have a simpler model of aeroplane?i've gone through that website earlier..do you have other samples such as the basic shape of an aeroplane which is simpler...or juz the vertices..i cant visualise the 3d (x,y,z), the z value confuses me...arghh..can u help me on the vertices ?
0
InteractiveMindCommented:
Okay, like a stick-figure of a plane?

You may need to spend a while configuring your setup a little, to get this to look right —  But try something like this:


glBegin( GL.GL_LINES ) ;
    // The fuselage
    glVertex3d( 0, 0, -5 ) ;
    glVertex3d( 0, 0, 5 ) ;
   
    // The tail
    glVertex3d( 0, 0, 5 ) ;
    glVertex3d( 0, 3, 7 ) ;
   
    // The left wing
    glVertex3d( 0, 0, -1 ) ;
    glVertex3d( -7, 0, 3 ) ;
   
    // The right wing
    glVertex3d( 0, 0, -1 ) ;
    glVertex3d( 7, 0, 3 ) ;
glEnd() ;


You'll need to add a rotation or something, to enable you to see more than just a cross on the screen. ;)


A good way to learn how to work out the coordinates for something in your head, is by practising with a simple shape — such as a cube.. and then a cuboid... and so on..
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
InteractiveMindCommented:
glBegin( GL.GL_LINES ) ;

should be:

glBegin( GL_LINES ) ;

(I've gotten into some bad habbits - as I generally use OpenGL with Java)
0
TimYatesCommented:
Completely off topic:

>>  (I've gotten into some bad habbits - as I generally use OpenGL with Java)

Rob, if you use java 5, you can do:

    import javax.media.opengl.GL.* ;

and then you don't need the GL. stuff :-D

Anyway...just thought you'd like to know...

Back to the question now ;-)
0
InteractiveMindCommented:
:-O

I didn't know that! :-D

[ Looking through here:
  http://java.sun.com/j2se/1.5.0/docs/relnotes/features.html ]

Is there a name for this new feature? :-)

Thanks, Tim !!  :-)
0
TimYatesCommented:
"Static Import" :-D

http://java.sun.com/j2se/1.5.0/docs/guide/language/static-import.html

Hehehe, just saved you 3 characters typed per opengl call ;-)

Have fun!

Tim
0
InteractiveMindCommented:
hehe, well, if you've got 1,000 lines of this stuff.... :)

Thanks for that though — I should probably go through the list of new features to 5.0 (I've been meaning to for ages).
:-)

Rob
0
TimYatesCommented:
Some of them are cool :-)  Some (like autoboxing) are not (IMHO) ;-)

The GL defines are somewhere where static imports are good, but as that link says, if you use them too much you're just going to end up with something unmaintainable :-(  

I only use them for the GL things, cos I can't be bothered typing GL. all the time ;-)  Everything else I type in :-)

Tim
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Game Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.