No subject


Wed Jan 24 21:54:03 PST 2007


something that sorta-kinda works.

First of all I have defined the origin of my ellipse to be:

center_x =3D screen->w / 2;
center_y =3D screen->h / 2;

Then I set the radius in each direction to be:

x_rad =3D screen->w / 2;
y_rad =3D screen->h / 2;

Obviously this should allow me to put things around the circumference of =
an ellipse that has a diameter the hight and width of my screen...

Then I simply calculate where on that circumference an object will be =
placed by doing some simple trig like so:

obj->x =3D (cos(180 * M_PI / 180) * x_rad) + center_x;
obj->y =3D (sin(180 * M_PI / 180) * y_rad) + center_y;

Now, if I am not mistaken this should give the point that if this were =
graphed =20
in cartesian coordinated would rest at (x_rad,origin), right?

Now having just said that did I answer my own question? Since a video =
display is not in cartesian coordinates, do I have to do some sort of =
translation to my x,y values to get the actual point to plot?

Currently, under the given example, the sprite draws toward the left =
edge of the screen.

-Chris




More information about the SDL mailing list