Hi thank you very much, this is what I had in mind and a great starting point for me!!
I was wondering how one could move this further to the middle? cause I have tried everything but I get it never to move.
And if I would have another one( which almost mirrorers the function) and they would intersect, would it be possible to say the function should stop drawing when they both intersect? So not any higher...
And I would also like to colour it but I have only learned colouring with void draw, which gives me an error here.
Thank you very much for your help!!
Also I would like to delete the left side of the function and the right side of the other function that I want to add later on.
Alright I have been looking at my stuff now and I will need to make some changes but it seems to be ok. Thank you for your help already.
I have a completely different question now, is it possible if I for example have 3 certain points that form a triangle to colour the inside of it but that are only made out of line functions.
since the fill function does not work for it...
is there any way ?
ok I am also facing a new problem ^^
I would like to draw a leaf from a tree and I have all the values from the edges in a row in a ascii file so lets say I have all the x values(all left and all right) in a row and all the y values in a row.
so for example
line (data1 first value, data2 first value, data 1 second value, data 2 second value);
line(data1 second value, data 2 second value, data 1 third value, data 2 third value);
and so on
do you know how I could program that?
I dont know how I can tell processing to use the certain number at the certain point.
I could do it manually but I have many ascii files and this would take too long. So I would like to have one version with the variables (data1 first value, data 2 first value......) and then just change the ascii files later on.
but the colour example is still important as well.
So if you could help me one more time I would be really grateful!!
yes I know it is very different, I wasnt sure if I should start a new thread.
Ok the beginShape seems to be the right thing, at the moment it doesnt seem to work when I use line functions but with vertex function it does what it is supposed to do. Thank you for that!
I have looked at loadStrings but I am not sure how I can actually manage to say alright I would like to use the second data from that file and then the first one from the second file at a specific point.
To clarify things: I have x values such 365 356 344 370 and so on in an ascii file. and y values in a different file
Now I would like to write
line(*use the first value of the file with the x values, then the first one of the y file, then the second one of the x file, and then the second one from y file)
for the next one it would be line(*use the second value of the file with the x values, then the second one in the y file, then the third one of the x file, and then the third one from y file
and so on.. so later on I can just swith the x and y files and get new lines that are being drawn.
there is only a space between the values in the ascii files.
No problem with the thread, my remarks were only indicative, for the future.
You have to load both files. Just read them at once, unless they are multimegabyte in size, it shouldn't be a problem. Then you can use split() to get each part, and int() to convert these strings to integers.