[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

creating 3d aeroplane

Posted on 2006-03-27
14
Medium Priority
?
985 Views
Last Modified: 2013-12-06
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..
0
Comment
Question by:nwhan
  • 7
  • 3
  • 2
12 Comments
 
LVL 25

Expert Comment

by:InteractiveMind
ID: 16301955
Have you loaded a mesh of the plane from a file (such as .3ds, or something) ?
0
 
LVL 25

Expert Comment

by:InteractiveMind
ID: 16301973
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
 
LVL 1

Author Comment

by:nwhan
ID: 16302223
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 25

Expert Comment

by:InteractiveMind
ID: 16302259
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
 
LVL 1

Author Comment

by:nwhan
ID: 16302335
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
 
LVL 25

Accepted Solution

by:
InteractiveMind earned 200 total points
ID: 16302486
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
 
LVL 25

Expert Comment

by:InteractiveMind
ID: 16302496
glBegin( GL.GL_LINES ) ;

should be:

glBegin( GL_LINES ) ;

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

Expert Comment

by:TimYates
ID: 16319369
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
 
LVL 25

Expert Comment

by:InteractiveMind
ID: 16320547
:-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
 
LVL 35

Expert Comment

by:TimYates
ID: 16320560
"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
 
LVL 25

Expert Comment

by:InteractiveMind
ID: 16320674
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
 
LVL 35

Expert Comment

by:TimYates
ID: 16320689
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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is RenderMan: RenderMan is a not any particular piece of software. RenderMan is an industry standard, defining set of rules that any rendering software should use, to be RenderMan-compliant. Pixar's RenderMan is a flagship implementation of …
Recently, in one of the tech-blogs I usually read, I saw a post about the best-selling video games through history. The first place in the list is for the classic, extremely addictive Tetris. Well, a long time ago, in a galaxy far far away, I was…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month20 days, 12 hours left to enroll

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question