We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › Kumars Sketch: rotate, animate ellipse, text issue
Pages: 1 2 
Kumars Sketch: rotate, animate ellipse, text issue (Read 8974 times)
Kumars Sketch: rotate, animate ellipse, text issue
Jun 9th, 2010, 8:57am
 
Hi cedric,
              As you were asking for the archive file, I have uploaded it in the Rapidshire. The link is

http://rapidshare.com/files/397102745/emailsupdate.rar.html

The problems which am facing are

1.  When I compile the program the output which is a map in which the heading(which is email information) moves towards leftside when I point the cursor on a particular location.

2.  The ellipse which represents the number of emails received and sent should be more improvised by, If the number of emails are more, then the ellipse should be blinking while the ellipse with low number of email should be blink less.

3.  The movement I press left and right arrow buttons, a text message should be displayed on the output screen telling which column data is displayed.

                  Lastly, I would appreciate it if you could give me ideas for a better representation of the Map.

Please contact me if you have any further doubts


Thanks,
Kumar Smiley

Re: Visualizing data
Reply #1 - Jun 9th, 2010, 9:11am
 
this really didn't need a 4th thread. and certainly not one with such a vague name. can a mod please rename this...

for reference:
http://processing.org/discourse/yabb2/num_1273539925.html
http://processing.org/discourse/yabb2/num_1273671054.html
http://processing.org/discourse/yabb2/?num=1275998933
Re: Kumars Sketch: rotate, animate ellipse, text issue
Reply #2 - Jun 9th, 2010, 9:43am
 
koogy you are right. i asked to just use one thread to work on that sketch. so know as we have a 4th one. we should stop using the other ones.  I will take a look at your sketch later as soon as i have some time today.

btw. i renamed the post
Re: Kumars Sketch: rotate, animate ellipse, text issue
Reply #3 - Jun 9th, 2010, 10:24am
 
Alright, thats how we solve problems here ...
about your moving text. its pretty simple.
When moving over a circle you call  textAlign(CENTER);
thats fine, but in the next frame your email information text changes from Left alignment to center... so to fix that put  textAlign(LEFT); before the "Emails Information" line...

You can also call textAlign(CENTER) in setup and align all your text this way.
Re: Kumars Sketch: rotate, animate ellipse, text issue
Reply #4 - Jun 9th, 2010, 11:15am
 
Sorry cedric,

I will post all my problems in this thread only.

textAlign(LEFT) works,thanks a lot.

Am very sorry for bothering a lot
Re: Kumars Sketch: rotate, animate ellipse, text issue
Reply #5 - Jun 10th, 2010, 8:50am
 
kumar wrote on Jun 9th, 2010, 8:57am:
2.  The ellipse which represents the number of emails received and sent should be more improvised by, If the number of emails are more, then the ellipse should be blinking while the ellipse with low number of email should be blink less.
           


Hi cedric,

                  I got the following code form this forum with which the ellipse will be blinking in an more attractive way. The problem is that I  am not able to integrate my code with this program, am little confused with this. So, can you please integrate the following code with the actual code.


int radius1 = 5;
int rMove1 = 1;
int minRadius1 = 5, maxRadius1 = 100;
int xPos1 = 100;
int yPos1 = 200;

int radius2 = 5;
float rMove2 = 0;
int minRadius2 = 20, maxRadius2 = 140;
int xPos2 = 300;
int yPos2 = 200;

void setup()
{
size(400, 400);
//  frameRate(10);
}

void draw()
{
background(240);
noFill();

// Linear
ellipse(xPos1, yPos1, radius1, radius1);
radius1 += rMove1;
if (radius1 > maxRadius1)
  rMove1 = -1;
else if (radius1 < minRadius1)
  rMove1 = +1;

// Sinus
ellipse(xPos2, yPos2, radius2, radius2);
rMove2 += 0.02;
radius2 = (int) ((maxRadius2 - minRadius2) * sin(rMove2) + minRadius2);
}
     

Thanks,
Kumar
Re: Kumars Sketch: rotate, animate ellipse, text issue
Reply #6 - Jun 10th, 2010, 10:00am
 
its not that hard. if you replace the this line
ellipse(x, y, radius*0.8,radius*0.8);

with the following two lines for example.

they always keep half there original size, and scale to full size.
They dont slow down when shrinking, i used abs() to make them bounce cause i thought that would look better in this case.
I didnt change the blinking speed but only the size.

float pulse = radius*0.4+abs(sin(frameCount/10.0)*radius*0.4);
ellipse(x, y, pulse, pulse);


i am using sin like in your example but dont have two variables that i count up. i just use frameCount to do so. by dividing the frameCount in sin() you can adjust the pulsing speed. the first radius*04, is half of the original size it will always keep, and the other radius*04 is the other half that is pulsing.  

Re: Kumars Sketch: rotate, animate ellipse, text issue
Reply #7 - Jun 10th, 2010, 10:02am
 
or use these 3 lines, to make them blink faster as well

float pSpeed = map(value, 0, 180, 20, 1);
float pulse = radius*0.4+abs(sin(frameCount/pSpeed)*radius*0.4) ;
ellipse(x, y, pulse, pulse);
Re: Kumars Sketch: rotate, animate ellipse, text issue
Reply #8 - Jun 10th, 2010, 11:26am
 
Hi Cedric,

                  That was awesome work done by you. Thanks a million. I wouldn't have done this project without you. I really appreciate it. Now I will try doing the same with different shapes. Once again thanks my friend for spending your valuable time on my project.

Thanks,
kumar
Re: Kumars Sketch: rotate, animate ellipse, text issue
Reply #9 - Jun 10th, 2010, 1:55pm
 
no problem, as you can see. most of the problems are easy to solve. it was more a problem of understanding in your case Smiley

keep working on that project, and let us know how it turned out.
Re: Kumars Sketch: rotate, animate ellipse, text issue
Reply #10 - Jun 11th, 2010, 9:24am
 
Hi Cedric,
                       As a development in my project. It is about the display of the ellipse. I want to display the ellipses which I want.  That is a text box needs to be displayed in which I will type the name of the places so that the following places would get displayed on the map. For example, if I type Galway and Cork in the text box, only these places should be displayed in the form of ellipse in the map.  Further, as I only know that there is text box in Control P5 library, but do not know how to integrate with my project code.
Sorry to bother you,

Thanks,
Re: Kumars Sketch: rotate, animate ellipse, text issue
Reply #11 - Jun 11th, 2010, 10:02am
 
not sure if entering the city in a text box is the best way to do this. How do people know what cities exist. what if people write it wrong, entering two or more names, makes it even more complicated.

what about some check boxes ?
you just create a boolean variable for every city and draw the ellipse when it is true. and by clicking the check box you can turn on the cities you want to compare.
Re: Kumars Sketch: rotate, animate ellipse, text issue
Reply #12 - Jun 11th, 2010, 5:42pm
 
Hi cedric,

sorry cedric as kumar asked about textbox search. which is related to my project.am doing project on visual help system. same as kumar project, in my code am showing ellipse with number of queries values.I want to display the ellipse which I want.  That is a text box needs to be displayed in which I will type the name of the places so that the following places would get displayed on the map. For example, if tourist people type Ireland and England in the text box,(they want to know how many people ask about Ireland and England)only these places should be displayed in the form of ellipse in the europe map.  Further, as I only know that there is text box in Control P5 library, but do not know how to integrate with my project code.


Sorry to bother you,

Thanks,
Devika
Re: Kumars Sketch: rotate, animate ellipse, text issue
Reply #13 - Jun 11th, 2010, 5:42pm
 
u can download my code from this link http://rapidshare.com/files/397907410/europe.zip.html
Re: Kumars Sketch: rotate, animate ellipse, text issue
Reply #14 - Jun 12th, 2010, 6:57am
 
Hi cedric,

Can u help me regarding text box search,am new to the processing(I don't know it is possible or not when I type only country name in search box so that the following place should be displayed on the map).
 
please let me know if u have any doubts about my project.

Thank you,
devika.
Pages: 1 2