weird thingy in flowfield

Discussion forum for G-Force users

Moderators: BTT, andy55, b.dwall, juxtiphi

Post Reply
dklr
Posts: 40
Joined: Tue Jun 14, 2005 4:18 pm

weird thingy in flowfield

Post by dklr »

Why des this flowfield look strange near the "planets"

Code: Select all

//locations of "planets"
A0="rnd(2)-1"
A1="rnd(2)-1"

A2="rnd(2)-1"
A3="rnd(2)-1"

A4="rnd(2)-1"
A5="rnd(2)-1"

//masses of "planets"
A6="rnd(.005)"
A7="rnd(.005)"
A8="rnd(.005)"

//distance
D0="sqrt( sqr(x-a0) + sqr(y - a1) )"
D1="sqrt( sqr(x-a2) + sqr(y - a3) )"
D2="sqrt( sqr(x-a4) + sqr(y - a5) )"

//angle
D3="atan2( (x-a0), (y-a1) )"
D4="atan2( (x-a2), (y-a3) )"
D5="atan2( (x-a4), (y-a5) )"

//force
D6="a6/sqr(d0)"
D7="a7/sqr(d1)"
D8="a8/sqr(d2)"

srcX="x + d6*sin(d3) + d7*sin(d4) + d8*sin(d5)"
srcY="y + d6*cos(d3) + d7*cos(d4) + d8*cos(d5)"

Vers=312

Rovastar
Posts: 295
Joined: Wed May 05, 2004 9:25 am
Location: Derby/London, England

Post by Rovastar »

I am not sure what you are trying to do but I think you have used atan2 wrong.

atan2(y,x) arctangent of y/x (range is -PI to PI)

Whereas you appear to have used it
atan2(x,y)

So they need to be

D3="atan2((y-a1), (x-a0) )"
D4="atan2( (y-a3), (x-a2) )"
D5="atan2( (y-a5), (x-a4) )"

Here is the full config witha few changes by me.

Code: Select all

//locations of "planets"
A0="0.5*(rnd(2)-1)"
A1="0.5*(rnd(2)-1)"

A2="0.5*(rnd(2)-1)"
A3="0.5*(rnd(2)-1)"

A4="0.5*(rnd(2)-1)"
A5="0.5*(rnd(2)-1)"

//masses of "planets"
A6="0.001+rnd(.001)"
A7="0.001+rnd(.001)"
A8="0.001+rnd(.001)"

//distance
D0="sqrt( sqr(x-a0) + sqr(y - a1) )"
D1="sqrt( sqr(x-a2) + sqr(y - a3) )"
D2="sqrt( sqr(x-a4) + sqr(y - a5) )"

//angle
D3="atan2((y-a1), (x-a0) )"
D4="atan2( (y-a3), (x-a2) )"
D5="atan2( (y-a5), (x-a4) )"

//force
D6="a6/sqr(d0)"
D7="a7/sqr(d1)"
D8="a8/sqr(d2)"

srcX="x + d6*sin(d3) + d7*sin(d4) + d8*sin(d5)"
srcY="y + d6*cos(d3) + d7*cos(d4) + d8*cos(d5)"

Vers=312 
Is that the sort of thing you were trying to acheive?

willrob
Posts: 199
Joined: Fri Apr 29, 2005 1:44 pm

Post by willrob »

Neither version works for me. This is a flowfield, right? If I select either with the toolbar, it quickly changes to another random ff.

dklr
Posts: 40
Joined: Tue Jun 14, 2005 4:18 pm

Post by dklr »

willrob wrote:Neither version works for me. This is a flowfield, right? If I select either with the toolbar, it quickly changes to another random ff.
try updating g-force

dklr
Posts: 40
Joined: Tue Jun 14, 2005 4:18 pm

Post by dklr »

Rovastar wrote:

Code: Select all

//locations of "planets"
A0="0.5*(rnd(2)-1)"
A1="0.5*(rnd(2)-1)"

A2="0.5*(rnd(2)-1)"
A3="0.5*(rnd(2)-1)"

A4="0.5*(rnd(2)-1)"
A5="0.5*(rnd(2)-1)"
What is the 0.5* for

Rovastar
Posts: 295
Joined: Wed May 05, 2004 9:25 am
Location: Derby/London, England

Post by Rovastar »

I was reducing the amount of random variable range. I though -1 to 1 was too much as you were baising it on x (-1 to 1). I though I the random variable would dominate too much compared to the x or y.

Anyway I was just playing with it.

Did the atan2 thing solve your problem?

willrob
Posts: 199
Joined: Fri Apr 29, 2005 1:44 pm

Post by willrob »

I'm using the most current version of G-Force 3.1.3 (MaxOSX) and can't get either of these versions to function. Is thee a particular waveshape that triggers this flowfield better than others? Colormap? Using the Toolbar, whenI select the file, there doesn't appear to be any change on screen/

Post Reply