Wednesday, 15 April 2009

ouch

When messing about with my 12 string the other night, I appear to have bruised/banged/jarred whatever a nerve in the tip of my left index finger. Ok not exactly the worst injury in the world but you try typing with an index finger that goes ouch every time you press t,g,f,v,b,c,4,5,6. ouch.

So no more guitar playing for a while and am trying to learn to type without my index finger which makes my normally terrible typing 10 times worse...Still, at least I don't have to do any serious prodding of anything/one for while.

Not so many entries on here recently, sorry about that, I have been mad busy trying to add some maths to my game engine to generate a list of closest poly's to a point in a game env...am sure the 2 game developers who read this will be going, ahh..thats easy...

I certainly thought so when Dino asked for this to allow him to do some form of collision detect with a surface, (a track in this case) that did not use my normal ray cast system to determine height of the track.

Well no, actually it turns out its not, its actually bloody damn hard because the distance formula works fine and is fairly simple but both Dino and I had completely forgotten to allow for the fact that planes using point to plane distance formula are infinite....arrghhh so eventually all the planes on a fairly flat track will return the same or similar distance.

Which means dear reader(not you mum, you've gone already haven't you...mum?) , you then have to add some checks to see if you are actually intersecting in some way the the polygon of interest.....which requires some form of direction test..which means a ray.

arrghhhh

I really hate maths, I can understand most of it, and code it when I have a formula thats clear but this has really pissed me off. I had to re-write huge chunks of very nice easy to use ray cast code just to provide a result that was actually useless....not happy..For me this was a classic case of finding a complex solution to a simple problem, and like a mug I went ahead and tried to do it when I had a perfectly workable solution to hand...which I am now doing.

I broke my own golden rule of coding...don't reinvent the wheel.





Ahthankyew

No comments: