Function Menu
Check out the New Wiki

BushidoHacks.com

You now have the power to defend the earth like never before!

20080414

'Allo, ALUT! - Click!

I finally got around to creating my first program using sound.

While this may not be something to be excited about, it is a milestone in my opinion.

For years, I've been trying to figure out what I can use to create my own music using the computer. Then I found out a few weeks ago about MarioPaint Composer (MPC), based on the music program from the SNES game Mario Paint. The big let down of course: No version of Linux. Windows and Mac users should definely get into this easy to use program that will probably be appended to the Free Software List.

So what is there for the Linux users? Lots of softwares, mainly stuff that is still in development or requires external hardware. But this is for people with more experience in music. To them K.I.S.S. is a rock band rather than an acronym.

I'm finally on the verge of creating a program that I've been looking forward to making that does what all the other softwares other than MPC have failed to do: Create a very simple software sythesizer for the computer. No Keyboards or Drums to hook up. Nothing fancy or dumbed down. Just a program to turn the computer keyboard into a piano keyboard. If it works (and it should), then I'll think about adding all that fancy stuff.

The software that is going to help me do it will be OpenAL Utility Toolkit (ALUT), based on how the OpenGL Utility Toolkit (GLUT) was designed.

First off, there is a simple Hello, World program that they have. The one below has been modified for C++

/* helloalut.cpp */
#include
#include

int main (int argc, char **argv)
{
ALuint helloBuffer, helloSource;
alutInit (&argc, argv);
helloBuffer = alutCreateBufferHelloWorld ();
alGenSources (1, &helloSource);
alSourcei (helloSource, AL_BUFFER, helloBuffer);
alSourcePlay (helloSource);
alutSleep (1);
alutExit ();
return 0;
};


Next the saving part. I think it is time to show off how to create a simple makefile and use it. Note that TABs must be used not spaces when indenting commands. Because of this blogging software's limitations, any line thia is indendt with space should be denoted as a tab character.

# Makefile
helloalut: helloalut.o
g++ helloalut.o -lopenal -lalut -o helloalut

helloalut.o: helloalut.cpp
g++ -c helloalut.cpp -o helloalut.o


Thanks to this quick lesson in how to make Makefiles, I now know that it is unnecessary to enclose modules using -Wl--start-group and -Wl--end-group when linking modules. Ofcourse this may be limited to the Linux operating system, but it is a significant change that should be ammended to the GCC tutorial.

So what does this Makefile do? Well for starters, the default name for a Makefile is Makefile. The make program is the prgoram that used to install or remove prgrams directly from source on Linux and UNIX operating systems. Thus it is a good idea to keep the source files when you use make to install a program. Makefile can have a different name but it is probably a better idea just to use the default. Ergo, there can only be one Makefile per directory where there is a program to be installed.

The above Makefile would do this in the console:

g++ -c helloalut.cpp -o helloalut.o
g++ helloalut.o -lopenal -lalut -o helloalut


In the more fancy projects there is generally a couple lines added to removed the software that was installed which is generally make clean, but I'll have more details about that when I update the programming tutorial later. Stay tuned.

In order to use the Makefile, you should be in the directory where the Makefile is. So cd to the directory where the source is.

The fancy programs generally have a shell script called configure that is in the directory that is written to check if all the components for the software that is to be install can run. Before the Makefile is executed, run ./configure. You don't need a configure file to use make, but it is helpful if you are writing something fancy. Right now, the Makefile that is being discussed in this blog entry is sutable for just one computer.

So we've changed directories, made sure that everything is set to run, time to build the program! It is so very, very simple, If your Makefile is called Makefile, just type this command.
make

That's it. Nothing else to do execpt run that program.

But what about make install? You don't need to worry about that. That's if you are root and want to install the program in /usr/local/, and involves writing more advanced scripts such as the make clean command that undoes a make install. (Come to thing of it, I wonder how I can set up a make update when a new version of one of the fancy programs becomes available.)

Wow! I covered alot of ground today. I hope this helps everyone clear the air about how to use make as well as getting started with using ALUT.

Just remember to K.I.S.S.

Labels: , , , , ,



posted by Bushido Hacks 4/14/2008 01:46:00 PM (0) comments top

20080108

Why is there no SVG3D?

It occured to me that the way that VRML/X3D handles 3D models has not changed at all since it was first introduced in 1994.

VRML relies on a set of verticies to draw objects. This list of verticles can be come LOOOOONG! But don't get me wrong. SVG has the same draw backs as VRML and X3D, but SVG can use Bezier curves where as VRML and X3D are still using 3 dimmentional polylines. The math behind the Bezier curve is not that hard to implement and has been part of the OpenGL documentation for many years.

Thus when you use a program such as Blender (which has a terrible GUI, by the way) to transform .3ds into .wrl or .x3d files, you get a list of points that turn round edges into square edges made up of more nodes than the smooth surfaces that were defined using a Bezier surface.

Maybe this is something to check out later and see if their is a way to extend SVG into 3D.

Labels: , , , ,



posted by Bushido Hacks 1/08/2008 02:05:00 PM (0) comments top

20061127

Book mark everything in this post

For those of you who have found my GCC & GLUT installation instructions extremely helpful, I thank you for your kind words and feed back.

Sadily, I do not have the time nor the resources to show examples or syntax of C, C++, or OpenGL.

Fortunately, I have found these resources to be VERY helpful over the break.



Other things I've picked up over the holiday include a few cellphone hacks for the RAZR. I was bummed out that I couldn't use that Blackberry I got on eBay. Never the less, I will be a sufficent backup device should my RAZR turn into a brick as I rage against Ma Bell. (Fight the machine! Woooo!)

First off, screw Ma Bell (Cingular) and her $2 ringtones and lack of work tools. According to Stephen Pierzchala in a May 2006 blog entry, the V3 has about as much processing power as one of the first 386 computers. This seems plasable considering that the Texas Instruments TI-83 graphing calculator could have easily replaced the command module on the Apollo spacecraft. I'm interested in doing the same thing to my RAZR that Pierzchala did, only without wiping the firmware. One program that I especially have my eye on is MIDPssh, a terminal emulator for mobile devices. Thus, over the Christmas break, I plan on doing some modding on my RAZR. A couple good RAZR mod sites are MotoModders.net and PlanetMotox.net. Hacker websites like Binary Revolution are also a good source for things that annoy the phone company.

Labels: , , , , , , ,



posted by Bushido Hacks 11/27/2006 09:33:00 PM (0) comments top

20061120

PS3 Do Not Want

Man, this was PAINFUL TO WATCH!

I was watched XPlay, read Maddox's Latest post, read Penny Arcade's review, and Slashdot even the business and technical aspects of the PS3. Then I saw it first hand myself.

The PS3 is not just a train wreck, it is a train wreck with a chemical chlorine spill at 3AM that kills everyone in the nearby town in their sleep.

The Business men say that the PS3 is a finanical loss. The game critics were floored by several of the games because they sucked so bad. Being an OpenGL programmer, the horrendous use of glOrtho (the function that controls camera angle and viewport) is enough to make me vomit!

You hear me! VOMIT!

I've never used such a word in my blog in the two years it has been online in such a literal context. The graphics in these games make me want to cry, and I'm a casual gamer who plays less than two hours of video games per week.

I mean, AWEFUL!

Vehimate (sp) words can only describe the PS3. It hurts so bad.

On the other hand, this proves that proprietary SHOVELWARE and overpriced five-minutes-ago technology suggested by the salarymen at Sony in order to "bring in a profit" ONLY TO HAVE IT BACKFIRE because more money went into advertising than supporting the programmers who make the games.

EVERYONE AT SONY SHOULD BE FIRED! NO EXCEPTIONS! And if they are not fired, the need to be struck down with the wrath of God.

The winner this fall: Wii and Xbox 360.

Labels: , , , , , , ,



posted by Bushido Hacks 11/20/2006 04:56:00 PM (0) comments top

20050201

A crash course in OpenGL with airbags - Click!

The past two weeks I have been racking my brain trying to get OpenGL to work. Fortunately, I finally found some one who can help.
Compiling Instructions
Shell Script Instructions

As it turns out, my computer had GLUT, the OpenGL Utility Toolkit, and Mesa all along. In retrospect, I wish I had not upgraded/downgraded the files I already had. But I'm OK. If something bad happens I'll be sure to list it here.

Now, before you get all "Perhaps my computer has this already." Be certan that you do! Some of them have been packaged with GCC. But the most important thing that you should have, is X11. If you are using Linux or Unix, you're OK. Windows and MacOS users will have to keep looking.

Simple instructions:

If you plan on using more than one C++ file for a multipe object program for OpenGL (recommended!)
1) c++ -c gears.cpp -o gears.o
2) repeat step one for each module you plan on using
3) When you have all your .o files ready, execute the following line.
c++ -Wl--startgroup gears.o ... --Wl--endgroup -o gears.exe -I/usr/X11R6/include/ -L/usr/X11R6/lib/ -lglut -lGL -GLU -lX11 -lXmu -lXi -lm


I'll post a template for an OpenGL file later.
Check out the two links to seen what the attributes do.

Labels: , ,



posted by Bushido Hacks 2/01/2005 01:44:00 PM (0) comments top

top | Some Rights ReservedRSS FeedSEND E-MAIL!bushidohacks.com © 2004-2008