You are viewing [info]scottishpig's journal

May. 20th, 2012 @ 07:29 pm iTV's Titanic
About this Entry
Spiketail Hatchling
Haven't updated in a while... been too busy.

I've been a big Titanic-nut since a few months before the famous James Cameron movie came about in the autumn of '97. I still remember trying to compare the Titanic with the known sizes of things nearby and trying to fathom what it'd be like to see on the big screen.

Anyway, 2012 was the centennial of the sinking and iTV came out with a four-episode three-hour miniseries on the Titanic. Now... for the centennial of a disaster like this, you'd think there'd be no-holds-barred historical and visual accuracy. If you thought this, you're pretty mistaken.

Before the 1997 blockbuster was a little-known 1996 made-for-TV miniseries which is hugely analogous to this 2012 series. They both introduce a bunch of characters and plots and try to follow them through the famous list of Titanic events 'til after the sinking. Both the '96 and '12 series suffer from way too much talking, anachronistic human stories, ham-fisted social commentary, and fictions added to the plot. They both largely ignore the Titanic... 'cept the '96 version actually hits more of the required checklist than does the longer, newer, centennial series.

Let me back-track. In 1958, a movie "A Night to Remember" came out. It was somewhat remade in 1977 with "S.O.S. Titanic" (another made-for-TV mess that actually got all of its facts straight). Both these films set the checklist in motion. So, let's hit this checklist thing (starred entries were shown/mentioned in the new series, the ones with the plusses are shown or mentioned rather inaccurately or inadequately):
  • Locations
    • Grand staircase
    • Smoking room+
    • 3rd Class Common Area+
    • D-Deck Dining area*
    • Squash Court
    • Turkish Bath
    • Forecastle/Poop Decks
    • Forward Well Deck
  • People
    • John Jacob Astor
    • Bride and Phillips
    • Guggenheim*
    • Murdoch, Lowe, Lightoller, Boxhall*
    • Captain Smith+
    • Ismay+
    • Molly Brown*
    • Allison Family*
    • Made-up love story characters**
  • Events
    • Some sense of hubris regarding Titanic
    • Titanic takes to sea+
    • Iceberg warnings+
    • People kicking ice around on deck
    • Important ship parts get flooded
    • It's cold
    • The band plays to the end
    • Californian gets signaled+
    • Carpathia picks up survivors+
Essentially, the Titanic itself-- the famous story-- is largely glossed over and pushed into the background. Problems that really didn't exist (or were largely irrelevant) were pushed into the foreground. Also, the format was such that events were re-exposed each episode, which made the story more interesting, but took away from the reality that there was a ship and it was sinking. What's more, if you'll notice the lack of stars in the events list, I'd say that it was a decent soap-opera-ish drama about a sinking ship, but not the Titanic.

Anyway, interesting things-- like the story of the Allisons whose nanny kidnapped a child and fled the ship, leaving the parents and remaining child on the ship eventually to die-- are glossed over or sent to the background. Real dramas based on historical fact are usually the plot-devices of most Titanic movies. If this series could have taken all these plots that we've seen and read elsewhere and spun them into something serious and solid, this would be an excellent movie.

Instead, there's a bizarre plot about Italians (they run the A La Carte restaurant... which is constantly referred to as "Gratzi's"... and they're arrested and someone must pick the underwater lock in a scene reminiscent of another, more successful Titanic movie), two stories where people are cheating on each other, an intrigue about some of the wait-staff falling in love, and no caring whatsoever for the after-effects of the sinking. So, when Titanic sinks, we see some flashes on the horizon, are told the Californian came and rescued everybody, and the credits roll. The characters are so flat and uninteresting because they do nothing and haven't done anything. When the time comes for the ship to sink, nobody cares if they live or die. And speaking of sinking: of the three hours and seven minutes, only 10 minutes or so actually shows any water at all. All-in-all, it's a drab snoozefest with some serious writing and pacing problems. A hundred rejected soap-opera plots were thrown in a blender and poured over some art-student's Titanic project.

This is disappointing because it opens up beautifully enough. The first episode and a half had me going. "This is a lot of needless setup," I thought, "but the ending's going to be really fantastic." The music is nice and the sets are very clean (even if un-Titanicish) and a lot of care was taken to make everything look and sound nice (even if unauthentic).

Speaking of unauthentic: Smith (not Ismay) orders the ship to go faster to set a record. Watertight doors were mentioned, but nobody bothered to flip the switch on the bridge. The conversation between the captain and Andrews happened in one of the boiler-rooms which was flooded beyond what it should have been (rather than on the bridge or Andrews cabin), the carpenter and wireless operators were missing, Murdoch fires his gun on A-deck, where most of the lifeboat-loading took place (as opposed to the boat deck)... There's lots of stuff that suggests they did some research and then threw it away... which is interesting since 1997's blockbuster Titanic got so much shit RIGHT, they just underpresented it in favor of that shit Jack-and-Rose story.

So, it was moody and boring, but not appropriately sad. It pretentiously hinted at verity and credulity but missed the mark. This is a shit way to remember Titanic's centennial. Don't waste your time.

-M4RK
Apr. 18th, 2012 @ 11:26 pm The Objective See
About this Entry
Spiketail Hatchling
We're not talking about the Holy See, but rather the objective one.

Now, having some experience with Objective C, I can tell you that it's a kinda-different sort of beast-- both similar and different to Java and C++. Like C++, Obj-C is a superset of the C language. You can theoretically write a C program in either C++ or Objective C. The problem is one I've addressed before.

I'm delving deeper this time. Objective C is minimalist on its own. It's a cool toy, but it's real use comes with an Apple operating system: iOS for iPhone/iPad or OSX. For these, there's a standard library with lots of things like hash maps and mutable strings... sort of like Java or C++'s standard library.

Here's where shit hits the fan. C has malloc and free for memory management of your heap. It's pretty gosh-darn easy. C++ has new and delete. Java has new and a garbage collector. Objective C (with this standard library) has some alloc/init/retain/release/autorelease/dealloc nonsense where you have to worry about the retain count of your object. Things have gotten easier with ARC (automatic retain-counting), but that's only in new versions.

So, in C++ or Java, you say "ObjectX varName = new ObjectX();" and you've got your new object. In C++, it must be deleted ("delete varName;"), and in Java, it'll automagically know when nothing's calling upon your variable and quietly put it down when you're not looking. With Cocoa, when you make the object ("ObjectX *varName = [[ObjectX alloc] init];") it sets its retain count to 1. If you want to increment its retain count, you call the retain method-- I mean send the retain message-- "[varName retain];". When you release it, you replace 'retain' with 'release', and it'll call some internal 'dealloc' method. Message. Damn it.

That's the other thing about objective C is its nomenclature. In Java and C++, an object is defined by a class. It's abstracted by an interface. Classes contain methods. In objective C, classes are defined by interfaces which are abstracted by protocols. Classes contain message definitions.

This sucks that, like everything else Apple uses, it's just trivially different from the rest of the world.

On the plus side, while everybody else tries to bolt object-oriented-ness into C and make it resemble the C-syntax, Objective-C's object-stuff stands out in a Smalltalk-ian way. All the C nuts and bolts for conditionals, loops, and things still work. The C standard library remains untouched (unlike in C++, where include files gain a 'c' in front of them), and everything else is smashed on top.

In fact, if you threw together a Obj-C program and edited out any lines containing brackets (that aren't arrays) and @s, then you'd have a C program. (Well, also a couple of preprocessor directives, but I'll give 'em that). So, it's a quirky mish-mash of things. In fact, the language alone is interesting enough to play with, but not different enough to warrant serious attention. The addition of Cocoa makes it bothersome and unpredictable.

Here's an example. An object can be 'nil' (read NULL). Passing a message (calling a method) of nil is allowed. It does nothing. In Java or C++, this would cause some problems (since NULL doesn't have any methods). So, in this case, Obj-C is on the ball. Passing bogus / nonexistent messages doesn't cause any harm. Here's where Cocoa comes in, though. Passing messages to a deallocated (released or whatever) object results in a crash. Not an exception, mind you, the program crashes. (It's still C, remember?)

So, that's that. I'd like to say that I really like it, or I really hate it... but I don't. It's yet another C-ish language. It's different in the way that a MacBook is different from a Linux notebook... that special, superficial, pretentious-feeling sort of way.

Lecture adjourned.
-M4RK
Apr. 1st, 2012 @ 10:57 pm No Foolin'
About this Entry
Spiketail Hatchling
So, I haven't had time to update in a while.

Pocket Starfighter, a common topic in my recent LJ posts, hasn't changed. It's sad that the project is so close to completion but there's just not enough time to play-test and balance it. The good thing about that, though, is that I've got it living in an SVN repository and it won't be hard to finish it whenever. Only six people have downloaded it since last post.

So, I've got a new job at MillennialMedia as a technical support engineer. So far, everything is awesome. The company had its IPO just this past Thursday. While this is cool, it was kinda awkward being the new guy with all the hooplah of the MM veterans. On the plus side, it means I have to learn Android and iOS (and, in the future Windows Phone 7) programming. iOS, for iPhone, is probably the most difficult. I'd like to take a second to talk about Android.

In the past I might've mentioned my disdain for mashing XML and Java together. Android uses XML to layout the front end and then mashes it with Java for the back-end. Unlike J2EE, however, where one is mixing XML with HTML and linking it with beans, hear we use the manifest (this time, also in XML) to point to the entry point of the program (in Java) which points to the XML in its onCreate method. In short, it's still frightfully more complicated than a straight AWT or Swing interface where everything's a hundred percent Java.

What's more, iOS works the same way, almost. The difference is that it uses Objective-C rather than Java. That's a pile of laughs in itself. I seriously remember writing an LJ post whining about how C++ replaces a lot of the standard things of C, and while you can use the core C library, you really shouldn't. Well, the same thing holds true with Obj-C. I attempted to use a sprintf call for a quick-n-dirty test of something, but they've far outclassed me by making a NSString class which is wholly incompatible. What a surprise. Once again, the trouble isn't inherent to the language itself, but the standard library that comes with it.

Anyway, I keep feeling compelled to say something about my personal life on here, about the Angie drama and its aftermath, but there really isn't a need to explain anything and I'm content enough letting things end quietly. Any residual sadness is comforted by knowledge that it's the right thing to do.

So, that's enough of that. It is what it is, and it was what it was. Here come the brakes:

-Mark.
Mar. 20th, 2012 @ 12:06 pm Pocket Starfighter n' such...
About this Entry
Spiketail Hatchling
The last few weeks have seen a lot of crazy-positive changes going on in my personal life. While this is exciting and über-cool and has far-reaching effects on my future, my pet project Pocket Starfighter's been a little neglected.

About two weeks ago, I threw together a β-version and wrote a webpage for it (available here) and, without publicity, it's gotten ten-ish downloads which isn't too shabby for an obviously-incomplete game. Anyway, I've had some time today to start polishing it up. Some of the AI bugs are pretty easy to flatten out and additional command line arguments will help really fine-tune the gameplay. This is all cake stuff. The more difficult part is going to be balancing the various types of ships that are already in the game and adding new ones that are interesting.

Besides that, Cosmos, a popular science television show from the late seventies and early eighties is now available for free on Hulu. Typically, I disagree with streaming large amounts of video over the Internet, but it's Carl freakin' Sagan. I've begun playing through Quake again. Despite the aged graphics, the engine really does stand the test of time and the challenges inside the game are very well thought-out. Lastly, there are a pair of youtube channels that I've been cruising... so more streaming video nonsense.

Here's my beef with streaming video: Firstly, it's a colossal waste of resources. Secondly, it's a very passive activity. Even reading forces some neural imagination. Videos, though, suck away your time and leave emptiness in its wake. Don't get me wrong: watching videos with someone, though, can be a social experience and a bonding thing... and that's cool and a different beast altogether. Too often, though, folks just get sucked into watching things, drooling, and pissing away their life to no avail. Excessive ∀x is bad, where x ∈ everything.

Back to Pocket Starfighter: There will be a definitive release version at some point in the future. It depends on how much time and imagination I can devote to it. The main problem is that I've coded all the fun and interesting parts and balancing things is pretty boring. Whatever: the beauty of open source is that people can do it themselves.

-Mark.
(Also, I learned "Mandelbrot" rhymes with "boat".)
Mar. 5th, 2012 @ 06:53 pm A Case for Iraq
About this Entry
Spiketail Hatchling
I generally don't like making this personal or political, but here it goes:

Our beloved president, the winner of the Nobel Prize for peace, has sided with Israel in our present middle-eastern crisis against Iran. Israel, which may or may not have nuclear weapons, wants to stop Iran's nuclear program. The funny thing is that Israel's never been visited by weapons inspectors, and while we suspect them, we're too busy being friends with them to realize they want to start war with Iran over supposed weapons of mass destruction.

I don't know about you, folks, but that sounds similar to some fishy other war we were in recently that stretched more than ten years, cost about $800,000,000 dollars and got us nothing. So, what? We want to do it all again. Flippin' great. Give our beloved saint of peace a weapon and ship him on the next plane to Iran, and send all the other war-mongers in Washington with him. What's more-- make him pay for it out of his own pocket.

-Mark.
Feb. 20th, 2012 @ 01:09 pm "The Machine Stops"
About this Entry
Spiketail Hatchling
I'm a huge fan of dystopian literature having read Huxley's "Brave New World", Zamyatin's "We", Bradbury's "Fahrenheit 451", and Orwell's "1984"-- in more-or-less that order. Today I had the pleasure of listening to "The Machine Stops" by E. M. Forster. (I've taken to listening to books for some reason. *shrugs*)

Anyway, it's a short story written in 1909 about a society that lives wholly underground. People eat, sleep, and communicate to each other from hexagonal rooms rather like a gigantic honeycomb. People generate ideas and share them over an electronic network through lectures. Living anywhere on the Earth is the same. Collectively, the honeycomb, the electronic circuitry, heating/ventilation/air conditioning, and a system of airships make up a system called "the Machine." Folks seldom used the airship system, since it was much more convenient to communicate electronically.

Interestingly, the author spoke of a "plate" on which you could see anyone in a Skype-ish fashion. Since television had not yet been invented, I give him kudos. The way people "log their ideas" is an oddly Twitter-ish idea. The whole concept of "winged airships" was also interesting since Wright's famous flight was conducted only six years prior to the story. The story doesn't go into much detail about the airships, other than they have individual cabins for each passenger– much more like a traditional ship than anything modern.

The most impressive thing about the story is how true it is to the natural human condition as it is now. How often have you been in a situation where you're face-to-face with another human being but don't feel like breaking down some imaginary social barrier and engaging in honest-to-goodness communication? It's becoming more common. How often do folks, when presented with this situation, pull out their cell phone and log their ideas to Twitter/Facebook/Whatever? Pretty often, also.

Anyway, the end of the story is kinda given away in the title, "The Machine Stops." It is, nonetheless, a very interesting story. ( Read! or Listen! )

-Mark
Feb. 12th, 2012 @ 10:36 pm The future...
About this Entry
Quake Logo
The future is coming.



Pocket Starfighter will probably be ready next month sometime.

It's going for a serious retro-feeling with super-minimized Linuxesque command-line power.

So far, it features:
  • Sixteen colors
  • Non-configurable keys (though, possible Dvorak support, if I remember)
  • No menus
  • Command-line support for game parameters
  • A dozen classes of ships (2 finished so far)
  • Three (count 'em!) dimensions
  • Title screen (maybe?)
  • PDF/plaintext manual so you know what the hell you're doing.


The last one is the real sticking point. I want a real kickass-looking manual. You remember the days when games came with manuals... and you had to read the manual to play the game? YEAH, fools. Those days are back with a vengeance. Pocket Starfighter, coming to SourceForge (probably) in 2012 (hopefully).

-Mark.
Jan. 30th, 2012 @ 06:59 pm Big numbers (or, Entropy in Art)
About this Entry
Spiketail Hatchling
As a computer programmer, I know that I hate it when folks say in regards to computer games, "Everything's been done." I'm sure artists hate it, too. They probably think, "I have passion and desire. I will create something that the world has never seen before!"

I hate to say it, but there truly is a limit to the stuff you can put on a screen, or on a canvas. Since I'm a computer dude, we'll stick with the computer screen. The average display resolution is currently 1024x786x32... that is everything that you see on your screen is represented on an array of pixels that is one thousand and twenty-four pixels across by seven hundred and sixty eight down. You could imagine it like a window screen with much smaller holes, except on a computer screen each hole is filled with only a single color.

That last number, the thirty-two, says how many colors can be displayed on the screen. Thirty two bits provides enough resolution for 2644-1 or 4,294,967,295 colors. Yup. Four billion. It's a pity the human eye can't identify that many. So, in real life, what I'm about to say, while true, may not be very precise.

Simple multiplication reveals that your screen, the entire screen, can only be in 3,377,699,719,741,440 different configurations. Yes, that's three quadrillion. It doesn't really matter the number. The point here is that it's finite. In truth, most of those configurations are trivial and meaningless. The first four billion would be just cycling the first pixel through all of the colors. The next four billion would bring the second pixel into play. Ultimately, most of the three quadrillion are pretty boring.

"So, what's the point?" you ask, once again, as you do with so many of these posts. "I wish Angie would get back so you'd bore her and not us," you complain. (I wish she'd get back, too...)

The point is this: Since graphics are now a finite quantity (and thus, by multiplication, so is animation and, ultimately, all visual experiences) games need to focus on game-play and story ideas. A text adventure or a rogue-like game uses preciously few graphics (if any) to build a story that's generated with graphics in the player's mind. While one could argue that this is limited, too, I'd argue it's more personal and affects more from the player than just the eyes-and-arms of traditional video/computer games.

Also, this brings me to the point of another interesting project idea: generate every 320x240x8 image possible. At about 100KB a picture times the 19,660,800 possible images, it would sadly take about 2,000 gigabytes... that's a few more than I have at the moment.

The project, though, if I had the physical resources, would produce pixel-for-pixel every frame of every video-game, movie, and television show rendered at 320x240. Granted, most of the stuff generated would be useless and trivial, and trivially close to the other images, the real gold would be in there, too. It would be every possible image in the world. I want to make that happen.

Anyway, enough of that for now.
-Mark.
Jan. 26th, 2012 @ 11:13 am X3: Reunion
About this Entry
Spiketail Hatchling
So, I broke down and bought the X3 bundle. So far, I've sank about eight hours into X3: Reunion.

It's often compared to Elite since it's got the same sort of components: trading and combat. From the outside, then, they're the same game. Trade to beef up your ship and then shoot the bad guys. X3 wins out, though, for a number of different reasons.

Firstly, in Elite, all the systems are more or less the same. There's a star, a planet, the jump point and a space station. All the trading is done on the space station. X3 has these stations, too, but many things are bought and sold at factories, power plants, shipyards, etc.

Elite also doesn't allow much in the way of ownership. You have your ship and whatever's in the ship, and that's it. Now, Elite's designed for a much simpler computer system, so I won't further knock it for missing things. But Elite's combat system is ridiculously hard for starting ships. X3 isn't much better... except the combat is definitely more winnable in X3. Kudos there.

X3 and Elite both have systems that the player travels through. Elite is more believable since the systems are pretty randomly distributed (in fact, its built with a procedural arbitrary number generator) where X3's sectors are distributed in roughly a grid. Elite wins out, here.

In short, Elite and X3 are very similar, and I hate to say it, but I prefer X3. I had to put the same amount of effort into learning the general gameplay of both games, but X3 seems more rewarding.

Moving away from the Elite comparison, I was a little disappointed in the visuals. I'm not sure what I was expecting. Some things they did really well: the jump-gates are beautiful; the planets in the backgrounds are equally astounding; many of the space stations are works of art (I never thought I'd have so much fun flying past a plankton farm)... On the down-side, a lot of the smaller 3D stuff isn't quite up to snuff. The communications videos would have been better-handled in 2D, and the "interior" of the "free trade vessels" are actually pretty ugly. Also, some of the sectors have a "nebular fog" to them. You can't see objects in the distance, which works and makes sense. How the fog itself is handled seems pretty amateurish. A slide-show of two-dimensional alpha-mapped images expand sequentially toward the player. It breaks the illusion of volume. The same sort of thing happens when you go through a jump-gate. So, the beauty of the jump-gate is slightly altered by the two dimensional jump sequence. Thankfully, it's short and doesn't really detract from anything. Also, while we're talking about the non-gameplay aspects of X3:R, the soundtrack is mellow but, in some places (like Kingdom's End) really fantastic.

I was also disappointed by the size of a sector. This disappointment was shortly-lived because one must explore the sectors. Ultimately, I am very happy with the "X Universe". It is a fun place to explore.

The combat is another monster altogether. Most ships are destroyed pretty easily. Along with that, though, the player's ship is pretty fragile, too. The combat is also pretty short compared with the time it takes to travel from one place to the next. This is probably a good thing since repairs are prohibitively expensive.

Also, the game has a fantastic open-endedness to it. There are five different ways to start the game. Three of them have the storyline disabled. Yup. The storyline of the game is completely optional. The game is fully playable as a "sandbox"-style game where you start a life in the X universe trading supplies, building stuff, and killing "bad guys".

Here's another word about that: There are five races of aliens in X3. You win favor with some by destroying others. There are also pirates and Kha'ak (sadly pronounced "Cock") who can always be shot down or captured.

Speaking of "captured": You can totally claim enemy ships that have surrendered and either fly them around for yourself or sell 'em or... do whatever, really.

Ultimately, the game is really deep, challenging, and rewarding. I can see why people get sucked into it. Despite its very minor shortcomings, the game is really, ridiculously cool and well worth ten bucks.

-Mark
Jan. 24th, 2012 @ 02:00 pm More sharing!
About this Entry
Spiketail Hatchling
You know, when I was more young and naïve, I thought there was so much that you had to be a wizard in order to accomplish on a computer. Now, either I've become a wizard, or, with adequate time, anybody can learn this crap.

Now, I've talked ad nauseam about 3D graphics. Raytracing and vector-style. Now, for my next trick, I'll show you how to determine mathematically if line passes through an arbitrary closed polygon.

Why's this important? I'm thinking (more and more seriously) about writing a primitive 3D space-shooting game, and in order to have a combat system work, I need to figure if the laser-cannons are colliding with the binding box of a ship. To eliminate the need for a tracking system, the lasers fire instantly and work as straight lines projecting from the front of a ship.

Let me be more precise: I want an arbitrary line to pass into or through an arbitrary polygon. We'll call the line L and the polygon Q, for quadrilateral. The line is defined by two points L1 and L2. The quadrilateral (though, you can use any shape you damn-well want), is made of four points: Q1 through Q4.

Testing for the line-shape intersection could be done a couple ways. We could ensure Q isn't rotated, and iterate a bunch of test points along L to see if the x and y values of the test point are within the bounds of the box, using > and < operators. This is only silly for a dozen or so reasons. Namely, we're not raytracing. We don't care about the distance at the intersection, just if there is one. Next, it would take a lot of those calculations. Lastly, having a box that "isn't rotated" sounds like the box isn't really arbitrary, and that's one of my requirements.

Instead, we'll turn to trigonometry. I'll introduce the idea in English and then throw some math symbols at you.

This English description is probably best if you drew a picture of a square on a piece of paper. Draw a diagonal line cutting through it. Now draw a dashed line from one of the points of the square to the left-most point of the first line. Repeat making these dashed lines through for all of the points of the square to the left-most point of the original line. You'll notice that they fall on both the right and left of the original diagonal line. This is how we're going to be able to tell if the line actually goes through the square. For mathematical certainty, we have to do the same thing from the right-most point of the line.

The idea can be pretty easily expanded into three dimensions, but we won't talk about that here. It's just adding more variables and doing the same thing.

Mathematically speaking, we find the angles with our old friend atan or, as the kids write these days, tan-1. Given a proportion, it returns an angle.

We'll call our line L and our square Q (for 'quadrilateral'), through this works mathematically for any polygon, not just a plain, old square.

First, we find the angle of L1 to L2 against the X-axis. We'll call it ΘL1L2.

ΘL1L2 = atan( (L2y - L1y) / (L2x - L1x) ) + π if L2x - L1x < 0, or
ΘL1L2 = atan( (L2y - L1y) / (L2x - L1x) ) otherwise.

In most programming languages, there's an atan2 function that accepts the numerator and denominator as arguments, and there's no longer a conditional.

Next, we need the angle to all Qi (i ∈ {1,2,3,4} in this case):

ΘL1Qi = atan( (Qiy - L1y) / (Qix - L1x) ) + π if Qix - L1x < 0, or
ΘL1Qi = atan( (Qiy - L1y) / (Qix - L1x) ) otherwise.

Now, we're done computing everything with L1. We're half-way there. Next, we repeat the calculations against L2. First, the line itself:

ΘL2L1 = atan( (L1y - L2y) / (L1x - L2x) ) + π if L1x - L2x < 0, or
ΘL2L1 = atan( (L1y - L2y) / (L1x - L2x) ) otherwise.

Then, you'll calculate your angles for Q in regards to L2:

ΘL2Qi = atan( (Qiy - L2y) / (Qix - L2x) ) + π if Qix - L2x < 0, or
ΘL2Qi = atan( (Qiy - L2y) / (Qix - L2x) ) otherwise.

So, now we've got all these Θs running around. We need to compare them to each other. We can quickly say that for our test to pass:

i,j,k,l : ΘL1L2 > ΘL1QiΘL1L2ΘL1QjΘL2L1 > ΘL2QkΘL2L1ΘL2Ql

Doing it in three dimensions (source code available!) is about double the effort. Q contains eight rather than four points for a simple bounding box. All the Θs are doubled, since we have to deal with a pitch and a yaw. This is the general idea, though.

Now you, too, can mathematically prove if a line intersects a polygon like a pro!

-Mark