Category Archives: Personal

C-A-Day

One of the suggestions my C programming professor gave us was to try to use a command line editor to do as many assignments as possible if we weren’t already familiar with one. Given that I fall in the “never used one” category, I decided to take it a bit further and do a sort of “c program a day” using Vim via the OS X terminal. The purpose is actually two-fold; I’m also using it to learn new algorithms as each program deals with an algorithm I’ve never tried writing before.

I started on the 16th by implementing Newton’s Method for finding the roots of the function x^2 = 916; in other words, the square root of 916. Yesterday I wrote a prime number sieve, and today I wrote a MergeSort implementation. I’m getting to know Vim pretty well too, and although I still prefer using an IDE I could probably survive with command line if I had to.

With regards to Ion Engine, I’ve done a bit of work on some small items over the last few days. I haven’t had time to sit down and work for a solid block of time so progress has been rather limited. Hopefully during this week I’ll be able to work on some other larger features on my list (terrain engine in particular).

Taylor

Advertisements

Math and Campus Maps

It’s been a few days since I’ve posted as I’ve been pretty busy with frosh week events here at Waterloo. Since I’m going into software engineering, I’m technically part of both the engineering faculty and math faculty and therefore participate in events from both faculties. At this point, all “softies” have earned their engineering hard hats and pink math ties:

The other night, one of the Comp Sci guys on my floor came to my room with a pretty cool math problem that would have fit well on Project Euler. It basically wanted to know how many downward-pointing triangles were present in a pyramid made of triangles. Of course, these downward-pointing triangles could be built from multiple triangles; for 4 layers of pyramid the answer is 7 because of one bigger multi-triangle:

Arriving at a computer-friendly answer is very easy, and requires a simple nested for-loop. I also found a slightly more elegant solution with only a single for-loop, but again this solution was fairly easy to come by. The hard part began when a few more CS/Eng students arrived and asked if we could find a single equation that would work for all cases that was “calculator-friendly”, i.e. without any looping. This was tougher.

We worked for several hours that night and didn’t really produce any solid results. I decided to try again earlier this morning and I’ve finally come up with an extremely ugly solution for cases were the number of layers (n) is greater than 4:

I’m still not satisfied, but I’m putting it away because I’ve already put way too much time into it.

 The second item I mentioned in my title is an idea for an app I’ve started working on. I used my iPhone + Google Maps to get around campus for the first few days, but this required some looking back/forth between the phone and the actual campus map. I think it would be handy to have a campus map super imposed onto Google Maps. In addition this map could take building names as start/end locations and plot the optimal route. I’m hoping to have this done by the time class starts on Monday. 😛

T


Move-In!

Well, it’s official, I’m a University of Waterloo student! Well not quite, classes don’t start until next week. The move was straightforward enough and I’m already starting to feel at home on campus.

Believe it or not, I still need to go buy several more textbooks. Many of the ones on my shelf are from previous courses I’ve taken that I thought might be handy for reference at some point.

Unfortunately today also marks a shift in gears as far as my own personal projects go. I’m still going to be working on my game engine, iPhone programming, RakNet, etc but will be unable to devote the same amount of time to them as I had over this past summer. It’s tough for me to judge how much free time I’ll have at this point in time, but I do know the program I’m in is supposed to require a significant weekly hour commitment. I guess I’ll just have to see how things go.

T


Rubik’s Cupe Map – Part 2

Earlier in the week I mentioned that I was working on “cube mapping” one of the may ways to solve a Rubik’s Cube. I’ve finished rendering out the final video of the process, starting with a scrambled cube and ending at a solved Rubik’s Cube. The movement in the cube is admittedly a bit harder to follow than I expected it to be, but the results were still quite interesting.

I’ve uploaded two versions of the video. One’s rendered at 24 fps and the other at 8 fps:

Rubik’s Cube Map Fast (24 fps)

Rubik’s Cube Map Slow (8 fps)

T


Rubik’s Cube Map – Part 1

As mentioned in my Chapters post, I’ve recently picked up a new classic 3x3x3 Rubik’s Cube. I’ve relearned a fairly simple solving method that only requires 6 unique move types to complete the entire cube, although it does take a lot longer than more advanced methods. Out of curiosity, I decided to try mapping the entire solving process into a series of images. The most logical way to do this was with a cube map, i.e “unfolding” the cube into 6 connected squares. A solved cube would look something like this:

There were only really two options to go about doing this. Solve it step by step and take 6 photos after each turn, or make a digital model in Blender3D. I chose the latter option, and built a digital Rubik’s cube from 27 unique cube objects. Animating the cube was simple; all I had to do was move the cubes I needed and insert them into new keyframes. I didn’t want any sort of rotational movement in the cube, just changing colors, so the keyframes are all one frame apart.

The first step was to “mess up” the digital cube. I rendered out an animation of this process, which is uploaded here:

http://vimeo.com/28371240

I realized quickly that moving the cube around digitally wasn’t going to be as easy as using the physical cube. To make the process easier, I decided to solve the physical cube simultaneously and make sure the digital model matched. This worked very well, until I messed up on the physical cube and couldn’t undo the error without bringing the two models out of sync. I ended up solving the physical cube completely and then following the steps from the digital cube’s animation to get back to where I needed to be. This was also around the same time when I began to wonder how good of an idea this whole project was. 😛

Eventually I got all 167 frames keyed in, including the scrambling process and a small delay after it. It was already pretty late, so I decided to leave things for the night and do the rendering and compositing today instead.

I ran the rendering process this morning, and I’ve now got a nice stack of 1,002 images that need to be merged into cube maps. Unfortunately I have no idea how to do this, aside from manually making each cube map. The Photoshop batch job system should be able to handle the task, I think, but I don’t know enough about it yet to make it do what I need. I’m looking into this now.

T


Chapters Trip

It’s been a while since I’ve done a post that’s not completely dedicated to my engine project, so this is a nice change. 🙂 At the end of the last school year, I was awarded a Chapters (the Barnes and Nobles of Canada) gift card for being the top in my physics class. I finally got around to spending it today while out buying some other stuff for university.

I wasn’t really sure what type of book to get. I don’t read very often, and since there are still a few fiction books at home I’d like read I decided to look for something non-fiction. I ended up taking a look at the “Computing” section just to see what was there. My expectations weren’t very high, as most general book stores only stock titles like The Complete Guide to OS X Lion, Microsoft Access 101 and, of course, The Internet for Dummies. This Chapters was different.

There was about a third of a shelf devoted to various iOS programming guides, ranging from Cocoa programming to interface design. And surprisingly enough there was an Android section too, which certainly wasn’t small either. I browsed through the entire selection of developer-oriented books and was almost going to go with a book on Perl, but I decided to get a Python 3 book instead.

I’ve used Python 2.x before in the past, but I’ve never sat down and actually learned about the details on the language or how to use it to its potential. Sort of like learning French for two years in a classroom and knowing a few verbs, nouns and adjectives I guess. In either case, I’ve always been a fan of Python and since it has so many practical applications it won’t hurt to become more familiar with it. I will need to add scripting support to my game engine at some point as well, and since I’d most likely have used Python regardless of my Chapter’s trip this will definitely help.

I also bought a new Rubik’s cube, since the book was less than my gift card’s value. I’d like to do some statistics/experiments with different solution patterns, but it’ll have to wait until I can get my solve times down into the sub minute range again. I used to be able to solve a cube in less than a minute back in grade nine, but my cube broke around the end of that year and I haven’t had one since.

I’m off to start reading my new book, so that’s all for now!

T


Ion Engine

I didn’t do any coding today since I’ve been putting a lot of hours into my game engine over the last few days. It’s nice to have  a break some times, after all. 🙂  I’m still aiming for a preliminary demo by Sunday, so I’ll probably start working on a basic UI system tomorrow. In the off time I also though several things I’d like to starting working on, most of which are going to involve some new programming concepts so they’ll probably have to wait. A terrain engine is one of them.

I did start working on a logo today, with one of the names I have in mind:

It’s not final by any means, nor is the name really, but I would like to be able to call my project something. Preferably sooner rather than later, too. I like the name “Ion Engine” since it’s short, catchy and easy to remember. I also can’t find any other active game engines under that name, unlike one of the other names I liked (Axiom). The science nerd in me also got a bit of a laugh out of the fact that my Abstract graphics layer could be stylized as the silver ion Ag+. Ha.

T


%d bloggers like this: