Saturday, August 30, 2008

Physic Screen Shot

Jep, its gone and now I can make up to 60 push ups now (15 - 4 times).

I've also made some serious programming lately, I finaly made some progress in the moment of inertia calculation.
First I planed to get the projeced shape of the mesh through ray tracing, but then a nice guy from the XNA community told me that the CPU is not quite build for such kind of calculation, the GPU is more made for it. So I just thought "Well, so why don't make it on the GPU?"
In the beginning I thought that there would be somethimg like that in the SpaceWar starter kid of XNA, but I was misstaking, but something like that dose no break me down. I just looked in the internet for a way to get a screen shot from a game, took that code changed it a bit (camera position, projection matrix, and general purpose), and done.

What I actually do is taking a screen shoot from the model I want the moment of inertia from. I just place the camera so that it face the model from a special direction (like from above) and use a orthogonal matrix. Furthermore I use a black background (GraphicDevice.Clear(Color.Black)) and I also set some rendering effect so that the model is white. What I get (or should get, I stilll got some problems with the quat that should diplay the new screen) is a white silouet of the model on a black background, now I got that I just have to make the moment of inertia calculation for each white point in this pic.

Its not finished yet, nor tested, but it appears to work fine for the moment and to be a loot easyer then I expected moment of inertia calculation to be.


I'm proud of my self. *giving myself a pat on the back*
Good boy.


And I hope that I see here this evening ...


Greg the Mad

No comments: