Cmonkey123
Wanderer
Circular Motion
I've started playing around with C# again, making simple games and other experiments in the hopes of making more complex interactive programs.
While working on a simple revolving sphere, I realized I can't figure out for the life of me how to make it revolve properly.
Does anyone know what equations or methods or anything I could possibly use to make an object revolve? Any help would be appreciated.
/edit
This is what I have so far (I found this equation for circular motion online, not sure if that's even close to what I want), but it doesn't work:
Obviously, I then use a draw command to draw the sphere at sphereX, sphereY. This doesn't freeze the program like many of my previous attempts, but the sphere stays at (0,0) and doesn't move anywhere.
I've started playing around with C# again, making simple games and other experiments in the hopes of making more complex interactive programs.
While working on a simple revolving sphere, I realized I can't figure out for the life of me how to make it revolve properly.
Does anyone know what equations or methods or anything I could possibly use to make an object revolve? Any help would be appreciated.
/edit
This is what I have so far (I found this equation for circular motion online, not sure if that's even close to what I want), but it doesn't work:
Code:
public void RotationTimerTick( object sender, System.EventArgs e )
{
int x = sphereX;
int y = sphereY;
int cos20 = Convert.ToInt32( Math.Cos( 20 ) );
sphereX = 100 * cos20 + x;
sphereY = 100 * cos20 + y;
Invalidate();
}
Obviously, I then use a draw command to draw the sphere at sphereX, sphereY. This doesn't freeze the program like many of my previous attempts, but the sphere stays at (0,0) and doesn't move anywhere.