Well, Bubba, it's possible to learn the concepts for 3D stuff and apply them with a very basic graphics library like SDL that doesn't require much to learn, before moving on to OpenGL or DirectX. That's what I did - sorta...I need to do that "moving on" bit.
Code:
while{
move++;
x=x+move*COS[direction];
y=y+move*SIN[direction];
draw_ball(x,y,15) /*15 is white color*/
vretrace();
draw_ball(x,y,0);
}
That is not what you want to do. I'm not sure what your "move" variable is supposed to be tracking, but what it's actually doing is increasing the speed of the ball (it's acting as the hypotenuse in the triangle you're using for the trig). Until a collision, your X and Y will both change at a constant rate (it's linear movement, afterall... unless you're trying to do something incredibly strange). Outside your while loop, do this:
Code:
deltax=ballspeed*COS[direction];
deltay=ballspeed*SIN[direction];
(I would also suggest *not* using lookup tables, and just using the trig functions. Lookup tables for trig functions have become obsolete because the time it takes to access the memory and load it into the cache and registers is quite comparable to the time it takes for the function call to the trig function itself.)
Anyway, inside your while loop, you'll want this:
Code:
while{
x+=deltax;
y+=deltay;
draw_ball(x,y,15) /*15 is white color*/
vretrace();
draw_ball(x,y,0);
}
I hope I made that clear. I've written about it in more detail here, which hopefully will be of some use to you. I also cover how to do the ball movement without any trig at all (except when initalizing the program). Good luck, and I hope to see the finished results posted soon.