PDA

View Full Version : [moved] Lines, arcs, circles.


dennishea
10-25-2006, 03:12 PM
I'm new to ppl and would like to know if I can use ppl to draw arcs on the screen of my ppc2003se? My screen is 240 x 320, which brings up 1 more quetion. Is there a finer increment then the 240 x 320? ?!

dennishea

PointOfLight
10-25-2006, 03:58 PM
You could use the GameAPI, and after calculating each point on the arc, use G_SETPIXEL to plot the point. Unfortunately, being terrible at the whole geometry thing, I can't really offer the code for calculating the arc at this point.

dennishea
10-25-2006, 06:46 PM
I have formula's for that but am unfamilair with ppl. I'm hoping to at least doodle 1 arc. How does a pixel relate to the screen? Is the screen 240 by 320 pixels or is pixel finer.

dennishea

ps
I've managed to do the hello world on my desktop and ppc.
I have worked with visual basic 6 and other forms of basic. The latest being basic4ppc. It's really a nice program but at the moment doesn't do well for the type of graphics I would like to do. Any help pushing me at the right code to solve for a single arc would be appreciated if I can do that in the free lite version.
I don't mind investing the time and some hair pulling to find out. If ppl will do that I would raid peggy bank and buy PPL PRO. Thanks in advance for Help.

Also forgot to say thanks POL for quick reply.

kornalius
10-25-2006, 07:29 PM
You first need to initialize the GAPI. Check the Simple.ppl demo in Demos\ folder to understand how the GameAPI works. There is a tutorial also in our Tutorials section.

Show us your arc routine maybe we can help you convert it to PPL.

dennishea
10-25-2006, 08:05 PM
I think something like this will work.

startangle = 45
endangle = 90
raduis = 10


for i = startangle to endangle
x = x + (radius * cos(i))
y = y + (radius * sin(i))
set_pixel x,y,color
next i

x and y is your home spot and your adding cos and sin respectfully.

dennishea

kornalius
10-25-2006, 09:44 PM
In PPL it will look like this:

startangle$ = 45;
endangle$ = 90;
radius$ = 10;
x$ = 100;
y$ = 100;

for (i$, startangle$, endangle$)
x$ += (radius$ * cos(i$));
y$ += (radius$ * sin(i$));
g_setpixel(x$, y$, G_RGB(255, 255, 255));
end;

You see how easy it is to convert a piece of code in PPL. The syntax is very easy.

PointOfLight
10-26-2006, 12:56 AM
The only problem is that you won't be able to test the drawing capability with the lite version of PPL, because it doesn't support the GameAPI - right, Kornalius?

dennishea
10-26-2006, 01:45 AM
If I activate the trial would I be able to try it then?

dennishea

kornalius
10-26-2006, 03:11 AM
Yes the trial key will work for 15 days in Pro mode. And you can update to newer versions of PPL during the trial period.

dennishea
10-26-2006, 12:03 PM
Whats the difference between pixel and sprite?

edit

It looks like sprite is adjustable and pixel is what it is what it is I think.

kornalius
10-26-2006, 02:58 PM
A sprite is basically an image that can be moved around on the screen. A pixel is what makes the screen. 240 x 320 pixels is the size of a normal QVGA PocketPC.

dennishea
10-26-2006, 07:49 PM
Thanks for the information kornalius. I appreciate all the help. I discovered that some systems deal in radians and not degrees. I've found the conversion formulas, but need to re research how to apply what I'm trying to do. Not knowing how to assemble code in ppl for experimenting with this venture is really hard for me. I'm a third shift worker so have to give up for the day and get some sleep for tonight. will tackle again tomorrow. Thanks again for all the help.

dennishea

kornalius
10-26-2006, 09:48 PM
We are here to help. Just ask questions here in the forums and we'll try to help you.