Tuesday, April 19, 2011

Working

I got my turret working. Or at least, it certainly seems it is working. See here:


The x axis is the x axis from the 3d vectors and the y value are the z height of the objects. Red is an object falling straight down at some position and green is the projectile fired. It seems like what I've done worked. But it doesn't make sense to me yet why.

What I'm confused about is how I fixed my problems I've had before. I changed the z velocity of the projectile to be v*sin(theta) and when calling an update to the projectile, instead of adding the position to the equation of the height I add the velocity instead. Somehow this works, but I do want to look into the mathematics before I do this. I'll update this project one more time if it turns out that this solution is not a fluke. And then start on a new one. I'm thinking of possibly coding up Tic Tac Toe to get my feet wet in some artificial intelligence.

No comments:

Post a Comment