24 Oct 2001 jaq   » (Journeyer)

haxoring

I've just spent the last 2.5 days trying to rotate an object in my scene in OpenGL -- I tried angle/axis using cross and dot products, I tried using quaternions, I tried sacrificial lambs. Every time the object would just be at some seemingly random orientation. I'm sure most people know, 2.5 days of pondering the same problem can make you a bit jumpy.

Anyway, just before lunch today, my train of thought went back to first principles of a rotation, namely breaking the destination vectors up into components and adding them onto the source vectors. I decided that was too much computation, I'm repeating calculations, too; why not just... stick them in a matrix... why not just turn these 3 basis vectors I have describing the target orientation into a matrix? I do so, run the code and it works.

I am stunned.

I am so stunned, because after 2.5 days of nothing working, you really don't expect some fantastical whim of an idea to actually work first go, especially if you haven't thought about the solution at all to verify that it'll work. I get some food, and the maths behind it falls into place, and I kick myself for not seeing this solution earlier.

And I'm still on schedule. There's hope for me yet.

meatspace

Oh, and I got paid today! /me does the dance of happiness

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!