So, this is just another funny 3D application i am trying to create using WPF.
It is a 3D animation kind of an application. After an ardous search, i finally figured out a way to create a 3D tennis ball in wpf. I have created a method that takes the x,y,z positions , size, etc as parameters.
In my code, i have called that method twice, and thus have got two tennis balls on my screen.:D..I have given the initial positions for both the balls as (0,0,0) and (3,3,3). Now, I would like to animate them according to the positions I give. Basically, I want the second ball to chase the first ball, but it can never catch the first one.;)
I have written a small chunk of code(as given below) that can give me new positions for both the balls every time the first for loop is executed. I am assuming that I will get 100 new positions according to the first for loop ? and the second for loops will execute two times as there are two tennis balls and their positions are stored in an array ?
Everytime the first loop is executed i want the new position to be passed to both the balls and I want to make the balls move and make it a continuous animation. I don't have any idea of how to do this and I have never done any 3D animations on WPF ever before.
I am a beginner and so Please go easy on me when explaining technical concepts. I would greatly appreciate any illustrations, examples and tutorials.
//Position generator
for(int frame=0;frame<100;i++)
{
for(int j=0;j<2;j++)
{
xposition[j] = xposition[j]+2;
yposition[j] = yposition[j]+2;
zposition[j] = zposition[j]+2;
}
}
Thanks