Programming 4 in PHP need a bit help

Put your programming skills to the test in these challenges.

Programming 4 in PHP need a bit help

Post by Nikousek on Thu Aug 28, 2008 4:07 pm
([msg=10592]see Programming 4 in PHP need a bit help[/msg])

Hi
at first i would like to ask if this is possible to do in PHP via GD library I assume so but i need to ask because
i am a bit stucked...:)

I have a script that saves every line and every arc into specific array and than I loop through each of those arrays and I draw lines/arcs with imagearc/imageline by GD library.I think I do everything correctly(but obviously i dont :D)
If there would be totally miss-shapes i would understand but some characters are fairly readable :)

Could anyone give me a hint if you see what is wrong ?

Here is the code for generating arcs and lines ...
Code: Select all
Code Removed


i even tried to make rounded values by floor byceause i dont know what is wrong :-/

and here is the image :)

Image
or this one
Image

Thanks for any hint
Dominik
Nikousek
New User
New User
 
Posts: 6
Joined: Thu Aug 28, 2008 12:18 pm
Blog: View Blog (0)


Re: Programming 4 in PHP need a bit help

Post by BhaaL on Fri Aug 29, 2008 8:47 am
([msg=10612]see Re: Programming 4 in PHP need a bit help[/msg])

Keep in mind how coordinate systems look like, and what specifics the canvas you draw on may have.
BhaaL
Poster
Poster
 
Posts: 270
Joined: Sun Apr 13, 2008 11:16 am
Blog: View Blog (0)


Re: Programming 4 in PHP need a bit help

Post by Nikousek on Sat Aug 30, 2008 5:16 am
([msg=10653]see Re: Programming 4 in PHP need a bit help[/msg])

BhaaL wrote:Keep in mind how coordinate systems look like, and what specifics the canvas you draw on may have.


Well this confused me a bit more than i was before :D

but still if I can recognize some characters perfectly on the canvas and I am using cycles to draw where could be wrong in coordinates...

Maybe i am drawing it bad in some way but it is hard for me I never used GD for drawing before , my first experience but i like this challenge much :) but I appreciate anyadvice :)
Nikousek
New User
New User
 
Posts: 6
Joined: Thu Aug 28, 2008 12:18 pm
Blog: View Blog (0)


Re: Programming 4 in PHP need a bit help

Post by BhaaL on Sat Aug 30, 2008 5:41 am
([msg=10654]see Re: Programming 4 in PHP need a bit help[/msg])

You should have noticed most of them are upside-down or mirrored. The plain cartesian coordinate system goes up/right for +x/+y - the canvas you draw on does not. It spans down/right.
BhaaL
Poster
Poster
 
Posts: 270
Joined: Sun Apr 13, 2008 11:16 am
Blog: View Blog (0)


Re: Programming 4 in PHP need a bit help

Post by Nikousek on Sat Aug 30, 2008 8:44 am
([msg=10657]see Re: Programming 4 in PHP need a bit help[/msg])

BhaaL wrote:You should have noticed most of them are upside-down or mirrored. The plain cartesian coordinate system goes up/right for +x/+y - the canvas you draw on does not. It spans down/right.


why does not?

I draw lines just by setting coordinates i got from xml :-/
Every line is new and specific I dont need any +x/+y maybe i am totally lost there maybe i just dont get what do you mean :)
Nikousek
New User
New User
 
Posts: 6
Joined: Thu Aug 28, 2008 12:18 pm
Blog: View Blog (0)


Re: Programming 4 in PHP need a bit help

Post by tio on Sat Aug 30, 2008 11:17 am
([msg=10664]see Re: Programming 4 in PHP need a bit help[/msg])

I dont know how is it in php when you draw an image, but in some languages is [0,0] in left top corner. But in real life is [0,0] in left bottom corner. That is the reason, why somethimes you need correct some cordinates
tio
New User
New User
 
Posts: 22
Joined: Tue May 13, 2008 11:01 am
Location: Slovakia
Blog: View Blog (0)


Re: Programming 4 in PHP need a bit help

Post by Nikousek on Sat Aug 30, 2008 11:35 am
([msg=10666]see Re: Programming 4 in PHP need a bit help[/msg])

tio wrote:I dont know how is it in php when you draw an image, but in some languages is [0,0] in left top corner. But in real life is [0,0] in left bottom corner. That is the reason, why somethimes you need correct some cordinates


oh thats explains everything thanks you a lot :) Bhaal meant the same as you but i didnt get it :( thanks a lot guys :)

I hope now i will go through
Nikousek
New User
New User
 
Posts: 6
Joined: Thu Aug 28, 2008 12:18 pm
Blog: View Blog (0)


Re: Programming 4 in PHP need a bit help

Post by Nikousek on Sat Aug 30, 2008 1:49 pm
([msg=10673]see Re: Programming 4 in PHP need a bit help[/msg])

I`ve completed the mission thanks a lot guys for help :)
Nikousek
New User
New User
 
Posts: 6
Joined: Thu Aug 28, 2008 12:18 pm
Blog: View Blog (0)



Return to Programming

Who is online

Users browsing this forum: No registered users and 0 guests