Jan. 31st, 2004

luckykaa: (Default)
Another techy diary.

I now have the world least efficient application for drawing a cross on the screen. Still, at least stage 0 is pretty much complete. I have a client side graphics engine which currently draws 3D crosses at the appropriate locations. It takes a strem aof data from the serer side game engine, indicating the poitions of all the on game objects. This means I can now get on with either the graphics bit or the game engine bit depending on how I feel, and be able to see the output.

I just need to write one piece of shared code. The Quaternion part.

Quats are great. I just don't 100% understand them. The basic principle seems to be that -1 has another square root, which we call j, and another called k, where ij = k and ijk = -1. Now, the from this, we can get jk = i, and ki = j, and curiously ji = -ij = -k, kj = -jk = -i and ik = -ki = -j. Unintuitively, when using quaternions, we lose commutivity. Not sure I quite understand what the basic rules are that all the others follow from, but they seem internally consistent. e.g. k2 = ij2 = ijij = -ijji = -1 x (i x -1 x i) = -12i2. Strictly speaking, the theory isn't important, but it's useful to get a handle on it. Sadly I don't quite.

Somehow these can be used for rotations in 3d space. This is probably the next stage of the game engine. I could just find a guide and implement it, but I really prefer to actually understand my own code.

In other news. Trains.

Why does a snowflake cause so much of a problem. Every year the trains pretty much grind to a halt. Not that that matters that much. Even in fair average weather, I have never known the 18:06 from Waterloo to Clapham Junction to arrive on time. I must have caught it at least 50 times. It usually arrives about 7 minutes late, unless it gets delayed. Because it was snowing, this train was packed. No idea why the snow causes so much more crowding, but it did, and I couldn't get on it. The fact that the doors were locked interfered with that as well. A less than 1 hour journey took 2 hours.

I did come up with a concept to keep the trains running adequately. It's a computer program with a pipeline optimisation algorithm. Work out all the dependencies of all the trains, drivers, and sections of railway, and they can be rescheduled on the fly when one of them breaks down, using a simple algorithm that tries to find the best slot for all subsequent trains.
Page generated Jul. 14th, 2025 03:57 am
Powered by Dreamwidth Studios