Aurebesh

This entry is part 1 of 3 in the series Aurebesh

A few days ago, I decided to study Aurebesh. What the banana is Aurebesh? Aurebesh is a made up writing system. It appeared first in Star War’s ‘Return of the Jedi’. If you’re interested in learning more about its history, I strongly recommend you read Wookieepedia.

Jedi

The force is strong with this young Padawan

For sure, you now think I’m a major Star Wars fan. Let’s just say, I enjoy the movies and I love the books written by Drew Karpyshyn. If somebody asks me, what I prefer more, Star Trek or Star Wars, I’ll answer without hesitation Star Trek.

So why am I learning that made up writing system? First of all, it’s easy to learn. It is basically English with different letters. So I don’t actually learn a new language. You could argument that it’s useless studying those letters. Maybe, but I think it’s cool being able to read articles in Aurebesh.

I am using several links to improve my reading. I use the timed translation at least once a day to measure my progress. I’m currently at 43 characters a minute (not very impressive, I know). Additionally, I exercise reading at least 10 minutes a day with the Aurebesh trainer. Last but not least, I downloaded the font, installed it on my machine and then set Firefox’s default font to Aurebesh. I wonder how long it will take me till I can use the browser with that font setting through out the day. For now, I limit myself to one short news article a day.

This is a new day, a new beginning.

As you can see, I also got the Aurebesh font plugin for WordPress from Jeremy Duenas. Now I can add here and there a saying to my blogs and only a few people will be able to read it.

Some reasons to use Emacs

I’m using emacs for several years now and it is by far my favorite editor. Don’t get me wrong, I do use Visual Studio for my MFC programs and don’t mind working with it, but there is just something about emacs. I recently was thinking of why I liked emacs so much and thought I’ll list my reasons to use emacs here.

The beauty of simplicity

Nowadays, there are many powerful and popular editors (Notepad++, Sublime Text, etc.) and IDE’s (Eclipse, Visual Studio, and so on) out there. I just find them often cluttered with buttons, menus, sidebars, etc. Emacs on the other hand (I’m now referring to the command-line and not the GUI version), consists of a simple window and no more.

For example, when I’m using Visual Studio, I hardly use any of the menu buttons (for many of the menu items, I know the key combinations anyhow). Those just take away space from my editing window. Of course, you can customize the toolbars, sidebars, etc. to your liking, but to enable efficient work on VS, I still end up with sidebars. The issue is not, that it prevents me from writing 200-300 character long lines (which, seriously, is highly undesirable), it’s more that it kind of forces me to switch btw mouse and keyboard frequently (though I’m sure there are some people that know how to work under Visual Studio/Eclipse without having to use the mouse hardly at all).

Efficiency

I remember when I started off with emacs. It was not as easy as I thought. I seriously was only able to work for about an hour on emacs without a break. Why? My hands starting aching. Why? I just wasn’t used to having my hands all the time on the keyboard. You don’t realize how often you switch between keyboard and mouse (and therefore wasting time) till you start using emacs (at least that’s how it was for me).

It took me about two to three weeks till I was comfortable working 8 hours a day on emacs. But as soon as I was, I was hooked. I find myself quicker on emacs than on any other editor since I can leave my hands on the keyboard without having to switch to the mouse frequently.

Powerful

Undoubtedly, emacs is a bit more difficult to start with than any other editor. As a beginner, you’ll need to learn at least the basic key commands (like move cursor to left/right/up/down, undo, mark text, etc.) to start using it. I admit that’s a major drawback and the main reason why it will likely remain a bit of a geek editor. But at the same token, as soon as you know the basics, you’ll likely find yourself to be way more efficient in text/code editing.

For example, I don’t have to switch to the explorer window to search for or copy a file. I simply type in the command to open dired in emacs and do whatever file/folder work I need to do. Emacs provides a huge (and still growing) amount of extensions which makes switching between applications almost dispensible. Emacs provides support for most programming languages, calenders, email program, twitter mode, and much more.

Customization

I feel like emacs can be much more customized to your liking than any other editor. You don’t just choose background/text/keyword colors and fonts(as most editors nowadays provide as well), but you can set automatic reminders (from calender, todo list, you name it), start emacs with multiple windows each containing your favorite modes/files (stack exchange, twitter, browser, …), display a clock at all times, and so much more.

Extensibility

This part has been completely neglected by me which I’m going to fix now. I’m finally going to start learning elisp. For way too long, I ignored the possibilities of creating my own extensions or of modifying existing ones.

If you google emacs, you’ll find a lot of beginner tutorials. One blogger, which I would definitely recommend subscribing to (or at least frequently visit her side) is Sacha Chua. She writes quite a bit about emacs (for beginners as well as for novices) and inspires you to use it daily.

Simple Beginner OpenGL programs

This entry is part 2 of 4 in the series Learning OpenGL

I’m currently at the 21st YouTube episode from Jamie King’s Playlist ‘3D Computer Graphics using OpenGL’. So far, I have created 3 little programs which are based on each other. All of them are available on Github.

The best way to learn a new language is by actually using it and that’s why I write little programs based on what I’m learning from the YouTube episodes.

My 2nd beginner program

The 2nd OpenGL program consists of a fixed pipeline (no use of shaders). It sets the background blue and then draws two white triangles.

Setting the background color is done via the glClearColor function.

For the drawing of the triangles, there are a few more steps required. First, you need an array with your vertices. Then you need to create a buffer OpenGL can use, which is done via the glGenBuffer function. This buffer then needs to be bound to GL_ARRAY_ELEMENT (since we have an array of vertices which form two triangles if you connect each of them) via glBindBuffer.

This OpenGL buffer object now still needs the actual vertice coordinates which we provide via the glBufferData function. Now all that’s left is to tell OpenGL that it can use that buffer via glEnableVertexAttribArray and we also still need to tell it how the buffer looks like (how many floats for a vertice, etc.) which is done via glVertexAttribPointer.

The buffer object is now ready to be used by OpenGL. We only have to tell OpenGL anymore about the size of the window to render which we do with glViewport and call the actual drawing function glDrawArrays.

My 3rd beginner program

The 3rd program improves memory usage of the previous program (though admittingly for that tiny array, it doesn’t really matter at all) and uses a simple vertex and fragment shader to actually color those two triangles created.

When creating an array of vertices, it is likely that you have a lot of duplication. E.g. one vertice of the first triangle could be the starting point of the second triangle. To avoid unnecessary duplication, you can use additionally to the GL_ARRAY_BUFFER also the GL_ELEMENT_ARRAY_BUFFER. That means I remove all duplicated vertices in the one array and create a second array with the indices. For that array, I generate again an OpenGL buffer and this time bind it to GL_ELEMENT_ARRAY_BUFFER. Last but not least, I have to give the new buffer object the indices array.

The drawing function glDrawElements is now a different one, since the indices array tells OpenGL which vertice comes next.

For the coloring of the triangles, we need to add the RGB floats to each vertice in the first buffer array. Then we tell OpenGL that the buffer array contains those color vertices as well via glEnableVertexAttribArray and glVertexAttribPointer.

Last but not least, we need to write simple vertex and fragment shader code (minimal.vert and minimal.frag in my example program) and then tell OpenGL to compile, link and use the shaders.

Pretty unspectacular what I’ve produced so far, but I’m looking forward to learning more and more.

Do. Or do not! There is no try. – Yoda