Skip to content

Commit 12d1f66

Browse files
committed
Example Notes
1 parent 327cada commit 12d1f66

File tree

5 files changed

+73
-4
lines changed

5 files changed

+73
-4
lines changed

examples/FlowField/FlowField_LIC/FlowField_LIC.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,19 @@
3636

3737
public class FlowField_LIC extends PApplet {
3838

39+
40+
//
41+
// Line Integral Convolution (LIC) Shader
42+
//
43+
// LIC is a low-pass filter, for sampling and averaging samples along the
44+
// streamlines of a flowfield (vector field).
45+
//
46+
// In this demo the flowfield is created by some simply mouse-drawing.
47+
// The background texture the sample are taken from should contain
48+
// high-frequency noise for the LIC-Shader to work best.
49+
//
50+
//
51+
3952
boolean START_FULLSCREEN = !true;
4053

4154
int viewport_w = 1680;

examples/FlowField/FlowField_LIC_Image/FlowField_LIC_Image.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,18 @@
3535

3636
public class FlowField_LIC_Image extends PApplet {
3737

38+
//
39+
// Line Integral Convolution (LIC) Shader
40+
//
41+
// LIC is a low-pass filter, for sampling and averaging samples along the
42+
// streamlines of a flowfield (vector field).
43+
//
44+
// In this demo the flowfield is created by some simply mouse-drawing.
45+
// The background texture is loaded from an external image by M.C. Escher.
46+
//
47+
//
48+
49+
3850
boolean START_FULLSCREEN = !true;
3951

4052
int viewport_w = 1680;

examples/FlowField/FlowField_LIC_OpticalFlow/FlowField_Viz_OpticalFlow.java renamed to examples/FlowField/FlowField_LIC_OpticalFlow/FlowField_LIC_OpticalFlow.java

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,20 @@
3535
import processing.video.Capture;
3636

3737

38-
public class FlowField_Viz_OpticalFlow extends PApplet {
38+
public class FlowField_LIC_OpticalFlow extends PApplet {
39+
40+
41+
//
42+
// Line Integral Convolution (LIC) Shader
43+
//
44+
// LIC is a low-pass filter, for sampling and averaging samples along the
45+
// streamlines of a flowfield (vector field).
46+
//
47+
// In this demo the flowfield is created by some simply mouse-drawing.
48+
// The background texture the webcam feed.
49+
//
50+
//
51+
3952

4053
boolean START_FULLSCREEN = !true;
4154

@@ -478,7 +491,7 @@ public void createGUI(){
478491

479492

480493
public static void main(String args[]) {
481-
PApplet.main(new String[] { FlowField_Viz_OpticalFlow.class.getName() });
494+
PApplet.main(new String[] { FlowField_LIC_OpticalFlow.class.getName() });
482495
}
483496

484497

examples/FlowField/FlowField_LIC_StreamLines/FlowField_LIC_StreamLines.java

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import com.jogamp.opengl.GL3;
1919
import com.thomasdiewald.pixelflow.java.DwPixelFlow;
2020
import com.thomasdiewald.pixelflow.java.flowfieldparticles.DwFlowFieldParticles;
21-
import com.thomasdiewald.pixelflow.java.flowfieldparticles.DwFlowFieldParticles.SpawnRect;
2221
import com.thomasdiewald.pixelflow.java.imageprocessing.DwFlowField;
2322
import com.thomasdiewald.pixelflow.java.imageprocessing.filter.DwFilter;
2423
import com.thomasdiewald.pixelflow.java.imageprocessing.filter.Merge;
@@ -38,6 +37,37 @@
3837

3938
public class FlowField_LIC_StreamLines extends PApplet {
4039

40+
//
41+
// Line Integral Convolution (LIC) Shader
42+
//
43+
// LIC is a low-pass filter, for sampling and averaging samples along the
44+
// streamlines of a flowfield (vector field).
45+
//
46+
//
47+
// LIC:
48+
//
49+
// In this demo the flowfield is created by some simply mouse-drawing.
50+
// The background texture the sample are taken from should contain
51+
// high-frequency noise for the LIC-Shader to work best.
52+
//
53+
//
54+
// StreamLines:
55+
//
56+
// Additionally to the LIC filter, the streamlines are computed and rendered.
57+
// This is quite expensive, since a lot of lines are required and each line
58+
// needs a reasonable amount of vertices (10-40).
59+
// All these vertices need to be generated on the fly by an alternating
60+
// update and render pass.
61+
// In the beginning for each line a particle is spawned and during the update
62+
// passes the particles positions are updated using verlet integration.
63+
// In the successive render pass, the last particle-step is rendered as a line.
64+
//
65+
//
66+
67+
68+
69+
70+
4171
boolean START_FULLSCREEN = !true;
4272

4373
int viewport_w = 1680;
@@ -279,7 +309,7 @@ public void draw(){
279309
int num_x = ceil(dim_x / (iterations * 0.5f));
280310
int num_y = ceil(dim_y / (iterations * 0.5f));
281311

282-
SpawnRect sr = new SpawnRect();
312+
DwFlowFieldParticles.SpawnRect sr = new DwFlowFieldParticles.SpawnRect();
283313
sr.num = new int[]{num_x, num_y};
284314
sr.dim = new float[]{dim_x, dim_y};
285315
sr.pos = new float[]{0,0};

examples/FlowField/Fluid_Basic_LIC/Fluid_Basic_LIC.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public class Fluid_Basic_LIC extends PApplet {
3737
// LMB: add Density + Velocity
3838
// MMB: draw obstacles
3939
// RMB: clear obstacles
40+
//
4041

4142
private class MyFluidData implements DwFluid2D.FluidData{
4243

0 commit comments

Comments
 (0)