Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Fadecandy
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
scanlime
Fadecandy
Commits
fbbcfd7b
Commit
fbbcfd7b
authored
11 years ago
by
Micah Elizabeth Scott
Browse files
Options
Downloads
Patches
Plain Diff
More param tweaking, better wander noise
parent
3f41ccb1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/node/rings.js
+7
-6
7 additions, 6 deletions
examples/node/rings.js
with
7 additions
and
6 deletions
examples/node/rings.js
+
7
−
6
View file @
fbbcfd7b
...
...
@@ -18,7 +18,7 @@ var client = new OPC('localhost', 7890);
var
noiseScale
=
0.02
;
var
speed
=
0.002
;
var
wspeed
=
0.7
;
var
wspeed
=
5.0
;
var
scale
=
0.1
;
var
ringScale
=
3.0
;
var
wanderSpeed
=
0.00005
;
...
...
@@ -48,11 +48,12 @@ function fractalNoise(x, y, z, w)
return
r
;
}
function
noise
(
x
)
function
noise
(
x
,
spin
)
{
// 1-dimensional noise. Cut a zig-zag path through
// the simplex 2D noise space, so we repeat much less often.
return
simplex
.
noise2D
(
x
,
x
*
0.01
)
*
0.5
+
0.5
;
spin
=
spin
||
0.01
;
return
simplex
.
noise2D
(
x
,
x
*
spin
)
*
0.5
+
0.5
;
}
function
draw
()
...
...
@@ -73,9 +74,9 @@ function draw()
// Random wander along the W axis
dw
+=
(
noise
(
now
*
0.000002
)
-
0.5
)
*
wspeed
;
var
centerx
=
(
noise
(
now
*
wanderSpeed
)
-
0.5
)
*
1.25
;
var
centery
=
(
noise
(
now
*
-
wanderSpeed
)
-
0.5
)
*
1.25
;
var
centerz
=
(
noise
(
now
*
-
wanderSpeed
)
-
0.5
)
*
1.25
;
var
centerx
=
(
noise
(
now
*
wanderSpeed
,
0.9
)
-
0.5
)
*
1.25
;
var
centery
=
(
noise
(
now
*
wanderSpeed
,
1.4
)
-
0.5
)
*
1.25
;
var
centerz
=
(
noise
(
now
*
wanderSpeed
,
1.7
)
-
0.5
)
*
1.25
;
function
shader
(
p
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment