Wow, that’s a mouthful, so how about a video to make it a bit clearer?

Basically, it’s a type of optical illusion, making a static image appear to animate, by taking a card with slits in it, and dragging it over the image. Of course, the image itself isn’t normal looking by any means – at best, it looks like a mess of blobs and lines – which is where the whole “optical illusion” comes in.

For example, here’s a colorful one that I made.

No, this isn’t a colorful inkblot test.

So, what’s the mess about? Well, it might be a little easier to understand, by looking at what the slits in the card does. Namely, each slit shows a portion of a single animation frame, and the space between slits, is equal to the width of the slit, times the number of frames in the animation, minus one. That “one” being the width of the slit.

Since that space between slits blocks out large portions of any given frame, it’s essentially “dead” space, that can be used for the other frames in the animation. Each frame has the dead space removed, and then is shifted over one unit to the right from the frame before it. Finally all the frames are merged together to form one image.

This is why moving the card from side to side, makes it appear that it’s animating – as each unit the card moves over, the slits display a different frame. Below is that same image as above, this time with an appropriate “card” over it. Drag the card right or left, to see the animation.

As an avid World of Warcraft player, I’ve always wanted to get a good capture of my characters, for use in other media. Unfortunately, the only options were third-party model viewers, which didn’t quite get things looking exactly how the characters look in game. While the Addon API gave access to a model viewer element, there was really no way of just capturing the model, without getting the background as well.

So, I had to come up with some way to get the transparency of the model, out of said background. The good news is, that I had full control over what that background would be, and “green screening”, isn’t just limited to film. The bad news, is that this method would only work for models that were completely solid. Any semi-transparency, such as glow effects, would blend in with that background producing a new color that was both visually wrong, but also couldn’t be filtered out.

Unlike film, using live actors, a digital “actor” can be copied, and both models could have their position, rotation, and even animation synced. So I elected to double up. This time, the first one would only take up half the width of the capture area. In the remaining space, a copy was added, this time with a blue background.



This method allowed me to have a green screened version, and a second version, that would contain the original green channel of that image. So, if I were to replace the green channel of the green side, with the green channel of the blue, I’d end up with the proper colors. However, simply doing that, just ends up with a black background, not a transparent one. Yet, the secret to transparency is also in those two green channels.

See, everything from the green side’s background, to the influence said background has on the glow effect, would be in that green channel, along with any other “proper” contributions to the color of the model. But the only thing in the green channel of the blue half,  are those “proper” contributions. So, if you copy the green side’s green channel, and invert it,  then copy the blue side’s green channel, and add them together, you end up with an alpha mask. To make it a bit more clear, here’s some basic pseudo code:

alphaPixel = Math.min((255-greenSideGreenPixel)+blueSideGreenPixel,255)

Which means that each pixel in the final image, would look something like this:

pixel = Color (greenSideRedPixel,blueSideGreenPixel,greenSideBluePixel,alphaPixel)

And the result:




Note: Maybe this will be a series, maybe not – it’s mostly to just put down my thoughts about games that I’ve played, that I feel need to be talked about – beyond just, “This game is awesome! go play it!”

First off, I try to stay away from console-oriented games as much as possible – mostly because the design focus differs quite a bit from the more open-ended focus of the games I tend to enjoy. However, when such a game is noteworthy enough, to get positive reviews from those few game reviewers I trust, I’m willing to bite the proverbial bullet, and give it a shot. Puns may or may not be intended.

Spec Ops: The Line was lauded for its narrative, and its portrayal of the psychological effects of violence. They’ve gone so far as to proclaim it as a true example of games as an art form. I’ll address these points; but first, I want to talk about gameplay.

The gameplay is…well, exactly what you should expect from a game with a console focus. Linear gameplay, checkpoint saves, auto-regenerating health, rail-shooter elements, and the general impression that the developer finds the story and production so important, that they can’t trust players to discover it on their own. Then toss in a wonky context-based control system, and a third person camera that ceases to be useful at all when firing a mounted machine gun, and said gameplay becomes pretty obnoxious – even by console standards.

But, hey – I’ll even “suffer” through what amounts to be an interactive movie, if the story is good enough. Unfortunately, it stumbles through that as well. See, the general concept of the story, is to portray the main character as someone who was driven insane, by a chain of events starting from a couple of “no right answer” scenarios. But the heavy-handed approach to development, and the insistence of having a pre-created main character, completely voiced and scripted, doesn’t work well with this goal.

See, in a movie, or a book – you can watch the main character lose control, and feel for them. You can sit from the outside, and watch the descent to madness step by step. You can do the same thing with a character in a game as well, but only if the perspective is the same. You can also achieve the same goal for a player character; but you have to make sure the player feels like they’re completely in control, while slowly distorting their perspective. Due to the nature of the player character, they had to attempt to use both methods. While that could, theoretically be done – its success depends heavily on the individual player. And all it takes is a couple of “Wait, why did he act that way?” and the entire thing falls apart.

The second issue was with the “no right answer” scenarios, and this ties heavily into the trend of binary “morality” mechanics, where the game forces you to into two decisions, or even one decision, by proxy. The first scenario was a situation where you come across a large group of soldiers, wearing the same uniforms as the ones that have attacked you through the previous levels. At this point, one of your squadmates points out a convenient mortar with white phosphorus shells. The other squadmate then voices his opposition, as it’s an especially cruel and inhumane method of killing people.

But here’s the thing – you literally have to use it. The game gives you no other choice. No attempt to talk, no option to merely walk away, merely walking out there will have them open fire on you, and if you attempt to take them out using more conventional methods, the game will deliver a literally endless flow of enemies until you’re dead. So, effectively – there is no decision at play here. So you go ahead and play the game the way the developer forces you to, and lo and behold, these soldiers were escorting civilians out of the area. So congrats, you just horrifically murdered a ton of civilians, which the game is all too happy to force you to see the gruesome results. At that point, the main character gets that numb gut wrenching expression on his face, and voices is intent to kill whoever is behind this. Presumably the first step towards his eventual insanity. Meanwhile, as the player, I’m just sitting here going “What the hell, devs?!”. That’s not a “no right answer” scenario – that’s a “you’re picking the wrong answer, because we’re forcing you to” scenario.

And then a bit later in the game, you’re forced into a situation where two people are suspended from a girder, both with enemy snipers aiming at them. You’re now told you have to chose which one dies – the civilian who stole water, or the soldier who killed the civilian’s family in the process of apprehending him. And of course, the game won’t progress until you do – but will immediately cut off all player control once the decision is made, while you watch (another) cutscene of the other one running away.

So, in the end, it’s a victim of its own focus. The player is merely the actor following the script, and held in check by the director, in what amounts to be an interactive movie in a shooter’s disguise. Roger Ebert once claimed that a game can never be considered art, because the player element comes between the creator and the work. Personally, I’ve always disagreed with this, despite understanding where he was coming from. But it’s games like this, that make me wonder if he might’ve been right after all. Because Spec Ops: The Line, might very well be a work of art; but it’s certainly not much of a game.

The industry needs more developers like VALVe and Bethesda – that understand that the player’s involvement in a story, is what makes the story have a purpose in the first place. Instead of just giving players something to do, until the next cutscene.

If you’re wondering why your project is desperately seeking “freeglut.lib”, instead of “freeglut_static.lib”, resulting in a linker error. Or a host of 2019 (unresolved external symbol) linker errors, if you try to rename freeglut_static, to freeglut, then your “problem” lies in the freeglut_std.h header file, that’s included in your project.

If you look at that file, you’ll see the following preprocessor conditional:

/* Windows static library */

# define FGAPI

/* Link with Win32 static freeglut lib */
# pragma comment (lib, "freeglut_static.lib")
# endif

/* Windows shared library (DLL) */
# else

# define FGAPIENTRY __stdcall
# if defined(FREEGLUT_EXPORTS)
# define FGAPI __declspec(dllexport)
# else
# define FGAPI __declspec(dllimport)

/* Link with Win32 shared freeglut lib */
# pragma comment (lib, "freeglut.lib")
# endif

# endif

# endif

So to use the static library, you’ll need to add FREEGLUT_STATIC to your preprocessor commands.

If you happen to be using GLEW, that also requires a preprocessor command before it will use the static library. In that case, it’s GLEW_STATIC.

I figured I might as well put a “front end” up, instead of just using my hosting for what amounts to online storage.

I’ll be honest – web design drives me nuts. Not that I don’t know how, or that it’s technically difficult. It’s more of an internal conflict, really. Part of me wants a nice looking site, that avoids the numerous usability failures you see on a lot of other sites. The other part just thinks it’s all useless crap that takes time away from coding something “cool”. So as a compromise, I just use WordPress, find a theme that has potential, and then spend the better part of a day tweaking the appearance, and modifying the theme itself to exorcise the stupid.

I’m more than likely not done yet. I haven’t tested out on anything but Chrome (Both Android and Windows versions), and I’m sure there will be more features as I have need of them, but at least visitors won’t be greeted by just the Siteground “Coming Soon” page anymore.