Hi all:
I had an idea the other day: make a hot air balloon
using allegro and opengl. Do you think this would be
a project a newbie could accomplish? If so, where would
one begin? I have had to give up on many things because
it got too difficult for me! This would be great if it
could be done!
Thanks for your time.
Set the bar low to start. A hot air balloon could be as simple as a circle with a square beneath it, or a sphere and a cube if 3D.
Note: Allegro doesn't really help you drawing 3D things. You need to do that with GL directly. Allegro will just initialize things for you I think.
After you've got a very simple program working you can expand upon it to make it better, piece by piece. If you aim too high you won't get anything done.
Hi bamccaig:
Great idea! If I start with a sphere, bring the bottom of the
sphere down, narrow it a bit I would have the shape I need.
Is there a way to do such a thing in opengl? Just a thought.
Thanks
I'm afraid OpenGL is far too complicated to learn it from questions and answers on a messaging board. If you don't know it yet you're going to have to learn it first. Put the hot air balloon idea on a shelf, and start by completing an OpenGL tutorial or two. Once you've got a simple program running you can try Googling for things that you think you'll need for the hot air balloon, and try to figure out how to do it. If you have trouble getting something to work you can post here, but don't expect us to do your homework for you. That's not how the Internet works. I can't help anyway because I myself haven't gone past the tutorial step.
Hi bamccaig:
Sorry, didn't mean to upset you!
Have a great day!
I'm not upset. I'm just trying to steer you in the right direction.
Step 1) Decide the technical requirements of what you want to do.
Step 2) Decide what is the best way to accomplish that
Step 3) Implement a very basic version to start
Step 4) Improve
Step 5) Repeat step 4
Step 6) Decide if you're satisfied with where you're at.
Step 6a) Go back to 1
Step 7) $PROFIT$
For instance, here's a hot air balloon I drew by accident. Allegro is more than capable of drawing a balloon as a polygon, a set of lines, etc... You don't specifically need to know OpenGL to do it.
http://members.allegro.cc/EdgarReynaldo/previews/Spiraloid/Balloon1.html
{"name":"Balloon1.png","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/d\/c\/dca6d415a73ea6eb425fd585553435af.png","w":1024,"h":768,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/d\/c\/dca6d415a73ea6eb425fd585553435af"}
EDIT
Technically you can think of a balloon as a series of discs layered together.
Once you have that, you can try to texture it.
Hi Edgar:
Thanks for the reply. It has been awhile, hope all is well!
I have downloaded 2 files: balloon.jpg and section.png. The
balloon file will show you what I am trying to duplicate. There
are 10 sections to the balloon. The section file shows one
of the 10 sections without the birds. My problem is the section
has to be fitted to the balloon shape. That is my problem. What
is the best way to do this? If you have any questions let me know.
Thanks!
Are you planning on a 2D balloon or a 3D one?
You need the vertices, and the texture coordinates.
From something like an .obj or some kind of model file.
Then you can draw with allegro or opengl.
Hi Edgar:
Oh, it must be 3D in opengl! As far as the .obj file: do I need to
do the balloon in Blender and then import to opengl? I hope not!
Thanks!
Make the strips horizontal. Vertical will only give you pain. Break them up into a band. Take a disc and make a bracelet. The outside of the bracelet is the band which you render in opengl. You still don't need OpenGL to do this, as allegro can do it for you.
hint
It can be done by hand with a little radial trigonometry in 3D.
Align it down the axis, and every band is just a circle of different radius connected to to the previous and next strip.
I've been playing with the problem of creating a hot air balloon in code and.. well.. maybe it helps:
(done using gluCylinder and gluSphere)
NSND! Let's see it!
Oh.. ok..
{"name":"612522","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/7\/3\/7383936d0090dfd1c00ea7c2d50fce70.png","w":606,"h":463,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/7\/3\/7383936d0090dfd1c00ea7c2d50fce70"}
dang, that's pretty good. Now just smooth out the sides, and you're golden.
@MikiZX: Out of curiousity, is there any reason you didn't use the Allegro 3D transform functions and primitive rendering?
Hm.. honestly said I was 'thinking in OpenGL' at the time and did not even think of Allegro5's transforms - I was just happy it worked.
Also, initialization of OpenGl and the part that sets the projection matrix come from posts posted on this forum few years ago by Edgar.
Though I am likely wrong, now that I think about it I think Allegro5 transforms are 2d oriented (Edgar is likely to correct or confirm this)? I think with Allegro5 transforms you always get a 2d/Ortho projection... ?
There are 2D and 3D transformations. The 2D transformations use 3D under the hood.
The projection matrix is whatever you set it to. It's all 3D under the hood. Ortho just gives you a flat space in a certain plane to work with.