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 & HelpOther Libraries › Traer.Physics Question
Page Index Toggle Pages: 1
Traer.Physics Question (Read 665 times)
Traer.Physics Question
Feb 19th, 2008, 11:48pm
 
Hello!

I have a code to create a dot matrix (6 x 7) and to draw some dot letter into the grid when pressing a key. I try to use traer.physics to make a smooth transition between the letter a and letter b. The highlighted points should move slowly in their new position. Things got complicated Wink

This is my Code so far: http://www.playground-berlin.com/fhp/raster/

Anyone knows help?

Greets
Re: Traer.Physics Question
Reply #1 - Feb 20th, 2008, 11:48am
 
So what's the problem? Smiley

I've something similar with images, you can check out my code http://jorgecardoso.org/processing/ParticleString/applet/index.html

jorge
Re: Traer.Physics Question
Reply #2 - Feb 20th, 2008, 1:56pm
 
Hello!

I took a look at your code and noticed, you moved the particles to their new position by "moveTo" command.

I tried to move them with some attraction to fixed particles, but they never arrive at their new position. I tried to use Springs, but i failed. Maybe i should use moveTo..

Greets
Re: Traer.Physics Question
Reply #3 - Feb 20th, 2008, 2:23pm
 
Ok, i tried the moveTo, is looks like this:

http://www.playground-berlin.com/fhp/raster1/
(give focus to the window and press "a" or "b")

But i think there's no need for the particle system if i simply rearrange the magenta dots?! I wanted to move them slowly and organic..

Greets
Re: Traer.Physics Question
Reply #4 - Feb 20th, 2008, 3:01pm
 
You have to use to sets of particles. One set is the desired final location. The other is the current location of dots. Each particle in one set is connected to a particle in the other set by a spring.

The moveTo is only applied to the particle in the desired final location set. They will slowly pull the other particles...

You also have to think about what happens to unused dots. One letter might have less dots than the current letter on screen, in this case some dots may: be pulled to the same location or just disappear...
Re: Traer.Physics Question
Reply #5 - Feb 20th, 2008, 4:42pm
 
I tried to do it like this. Two sets of particles, connected by springs. And then i used the attract command to move them to the new point. Or is it not necessary to use attraction if i use springs?

current state:

http://www.playground-berlin.com/fhp/raster2/

looks good, but you have to press each letter more then once. do you know why? Wink

Greets
Re: Traer.Physics Question
Reply #6 - Feb 20th, 2008, 5:27pm
 
tschiggi wrote on Feb 20th, 2008, 4:42pm:
looks good, but you have to press each letter more then once. do you know why Wink

Greets


You must call makeFixed() on the p2 particles when creating otherwise they will mutually attract...
Re: Traer.Physics Question
Reply #7 - Feb 20th, 2008, 6:35pm
 
Thanks for your help. Results look pretty much the way i wanted to have them!

Greets
Page Index Toggle Pages: 1