├── .classpath ├── .gitignore ├── .project ├── README.md ├── build.xml ├── core ├── .classpath ├── .gitignore ├── .project ├── .settings │ ├── org.eclipse.jdt.core.prefs │ └── org.eclipse.jdt.ui.prefs ├── build.xml └── src │ └── processing │ ├── core │ ├── PApplet.java │ ├── PConstants.java │ ├── PFont.java │ ├── PGraphics.java │ ├── PGraphicsAndroid2D.java │ ├── PImage.java │ ├── PMatrix.java │ ├── PMatrix2D.java │ ├── PMatrix3D.java │ ├── PShape.java │ ├── PShapeOBJ.java │ ├── PShapeSVG.java │ ├── PStyle.java │ └── PVector.java │ ├── data │ ├── FloatDict.java │ ├── FloatList.java │ ├── IntDict.java │ ├── IntList.java │ ├── JSONArray.java │ ├── JSONObject.java │ ├── JSONTokener.java │ ├── Sort.java │ ├── StringDict.java │ ├── StringList.java │ ├── Table.java │ ├── TableRow.java │ └── XML.java │ ├── event │ ├── Event.java │ ├── KeyEvent.java │ ├── MouseEvent.java │ └── TouchEvent.java │ └── opengl │ ├── FontTexture.java │ ├── FrameBuffer.java │ ├── LinePath.java │ ├── LineStroker.java │ ├── PGL.java │ ├── PGLES.java │ ├── PGraphics2D.java │ ├── PGraphics3D.java │ ├── PGraphicsOpenGL.java │ ├── PShader.java │ ├── PShapeOpenGL.java │ ├── Texture.java │ ├── VertexBuffer.java │ ├── shaders │ ├── ColorFrag.glsl │ ├── ColorVert.glsl │ ├── LightFrag.glsl │ ├── LightVert.glsl │ ├── LineFrag.glsl │ ├── LineVert.glsl │ ├── MaskFrag.glsl │ ├── PointFrag.glsl │ ├── PointVert.glsl │ ├── TexFrag.glsl │ ├── TexLightFrag.glsl │ ├── TexLightVert.glsl │ └── TexVert.glsl │ └── tess │ ├── ActiveRegion.java │ ├── CachedVertex.java │ ├── Dict.java │ ├── DictNode.java │ ├── GLUface.java │ ├── GLUhalfEdge.java │ ├── GLUmesh.java │ ├── GLUtessellatorImpl.java │ ├── GLUvertex.java │ ├── Geom.java │ ├── Mesh.java │ ├── Normal.java │ ├── PGLU.java │ ├── PGLUtessellator.java │ ├── PGLUtessellatorCallback.java │ ├── PGLUtessellatorCallbackAdapter.java │ ├── PriorityQ.java │ ├── PriorityQHeap.java │ ├── PriorityQSort.java │ ├── Render.java │ ├── Sweep.java │ ├── TessMono.java │ └── TessState.java ├── done.txt ├── examples ├── Basics │ ├── Arrays │ │ ├── Array │ │ │ └── Array.pde │ │ ├── Array2D │ │ │ └── Array2D.pde │ │ └── ArrayObjects │ │ │ ├── ArrayObjects.pde │ │ │ └── Module.pde │ ├── Camera │ │ ├── MoveEye │ │ │ └── MoveEye.pde │ │ └── Perspective │ │ │ └── Perspective.pde │ ├── Color │ │ ├── Brightness │ │ │ └── Brightness.pde │ │ ├── ColorWheel │ │ │ └── ColorWheel.pde │ │ ├── Creating │ │ │ └── Creating.pde │ │ ├── Hue │ │ │ └── Hue.pde │ │ ├── LinearGradient │ │ │ └── LinearGradient.pde │ │ ├── RadialGradient │ │ │ └── RadialGradient.pde │ │ ├── RadialGradient2 │ │ │ └── RadialGradient2.pde │ │ ├── Reading │ │ │ ├── Reading.pde │ │ │ └── data │ │ │ │ └── cait.jpg │ │ ├── Relativity │ │ │ └── Relativity.pde │ │ ├── Saturation │ │ │ └── Saturation.pde │ │ └── WaveGradient │ │ │ └── WaveGradient.pde │ ├── Control │ │ ├── Conditionals1 │ │ │ └── Conditionals1.pde │ │ ├── Conditionals2 │ │ │ └── Conditionals2.pde │ │ ├── EmbeddedIteration │ │ │ └── EmbeddedIteration.pde │ │ ├── Iteration │ │ │ └── Iteration.pde │ │ └── LogicalOperators │ │ │ └── LogicalOperators.pde │ ├── Data │ │ ├── CharactersStrings │ │ │ ├── CharactersStrings.pde │ │ │ └── data │ │ │ │ ├── Eureka-90.vlw │ │ │ │ └── rathausFrog.jpg │ │ ├── DatatypeConversion │ │ │ └── DatatypeConversion.pde │ │ ├── IntegersFloats │ │ │ └── IntegersFloats.pde │ │ ├── TrueFalse │ │ │ └── TrueFalse.pde │ │ ├── VariableScope │ │ │ └── VariableScope.pde │ │ └── Variables │ │ │ └── Variables.pde │ ├── Form │ │ ├── Bezier │ │ │ └── Bezier.pde │ │ ├── BezierEllipse │ │ │ └── BezierEllipse.pde │ │ ├── PieChart │ │ │ └── PieChart.pde │ │ ├── PointsLines │ │ │ └── PointsLines.pde │ │ ├── Primitives3D │ │ │ └── Primitives3D.pde │ │ ├── ShapePrimitives │ │ │ └── ShapePrimitives.pde │ │ ├── SimpleCurves │ │ │ └── SimpleCurves.pde │ │ ├── TriangleStrip │ │ │ └── TriangleStrip.pde │ │ └── Vertices │ │ │ └── Vertices.pde │ ├── Image │ │ ├── Alphamask │ │ │ ├── Alphamask.pde │ │ │ └── data │ │ │ │ ├── mask.jpg │ │ │ │ └── test.jpg │ │ ├── BackgroundImage │ │ │ ├── BackgroundImage.pde │ │ │ └── data │ │ │ │ └── milan_rubbish.jpg │ │ ├── CreateImage │ │ │ ├── CreateImage.pde │ │ │ └── data │ │ │ │ ├── mask.jpg │ │ │ │ └── test.jpg │ │ ├── LoadDisplayImage │ │ │ ├── LoadDisplayImage.pde │ │ │ └── data │ │ │ │ └── jelly.jpg │ │ ├── Pointillism │ │ │ ├── Pointillism.pde │ │ │ └── data │ │ │ │ ├── eames.jpg │ │ │ │ └── sunflower.jpg │ │ ├── RequestImage │ │ │ └── RequestImage.pde │ │ ├── Sprite │ │ │ ├── Sprite.pde │ │ │ └── data │ │ │ │ └── teddy.gif │ │ ├── Sprite2 │ │ │ ├── Sprite2.pde │ │ │ └── data │ │ │ │ ├── sky.jpg │ │ │ │ └── teddy.gif │ │ └── Transparency │ │ │ ├── Transparency.pde │ │ │ └── data │ │ │ ├── construct.jpg │ │ │ └── wash.jpg │ ├── Input │ │ ├── Clock │ │ │ └── Clock.pde │ │ ├── Constrain │ │ │ └── Constrain.pde │ │ ├── Easing │ │ │ └── Easing.pde │ │ ├── Keyboard │ │ │ └── Keyboard.pde │ │ ├── KeyboardFunctions │ │ │ ├── KeyboardFunctions.pde │ │ │ └── data │ │ │ │ └── brugges.jpg │ │ ├── Milliseconds │ │ │ └── Milliseconds.pde │ │ ├── Mouse1D │ │ │ └── Mouse1D.pde │ │ ├── Mouse2D │ │ │ └── Mouse2D.pde │ │ ├── MouseFunctions │ │ │ └── MouseFunctions.pde │ │ ├── MousePress │ │ │ └── MousePress.pde │ │ ├── MouseSignals │ │ │ └── MouseSignals.pde │ │ └── StoringInput │ │ │ └── StoringInput.pde │ ├── Lights │ │ ├── Directional │ │ │ └── Directional.pde │ │ ├── Mixture │ │ │ └── Mixture.pde │ │ ├── MixtureGrid │ │ │ └── MixtureGrid.pde │ │ ├── OnOff │ │ │ └── OnOff.pde │ │ ├── Reflection │ │ │ └── Reflection.pde │ │ └── Spot │ │ │ └── Spot.pde │ ├── Math │ │ ├── AdditiveWave │ │ │ └── AdditiveWave.pde │ │ ├── Arctangent │ │ │ └── Arctangent.pde │ │ ├── Distance1D │ │ │ └── Distance1D.pde │ │ ├── Distance2D │ │ │ └── Distance2D.pde │ │ ├── DoubleRandom │ │ │ └── DoubleRandom.pde │ │ ├── Graphing2DEquation │ │ │ └── Graphing2DEquation.pde │ │ ├── IncrementDecrement │ │ │ └── IncrementDecrement.pde │ │ ├── Modulo │ │ │ └── Modulo.pde │ │ ├── Noise1D │ │ │ └── Noise1D.pde │ │ ├── Noise2D │ │ │ └── Noise2D.pde │ │ ├── Noise3D │ │ │ └── Noise3D.pde │ │ ├── NoiseWave │ │ │ └── NoiseWave.pde │ │ ├── OperatorPrecedence │ │ │ └── OperatorPrecedence.pde │ │ ├── PolarToCartesian │ │ │ └── PolarToCartesian.pde │ │ ├── Random │ │ │ └── Random.pde │ │ ├── Sine │ │ │ └── Sine.pde │ │ ├── SineCosine │ │ │ └── SineCosine.pde │ │ └── SineWave │ │ │ └── SineWave.pde │ ├── Objects │ │ ├── CompositeObjects │ │ │ ├── CompositeObjects.pde │ │ │ ├── Egg.pde │ │ │ ├── EggRing.pde │ │ │ └── Ring.pde │ │ ├── Inheritance │ │ │ └── Inheritance.pde │ │ ├── MultipleConstructors │ │ │ └── MultipleConstructors.pde │ │ ├── Neighborhood │ │ │ └── Neighborhood.pde │ │ └── Objects │ │ │ └── Objects.pde │ ├── Shape │ │ ├── DisableStyle │ │ │ ├── DisableStyle.pde │ │ │ └── data │ │ │ │ └── bot1.svg │ │ ├── GetChild │ │ │ ├── GetChild.pde │ │ │ └── data │ │ │ │ └── usa-wikipedia.svg │ │ ├── LoadDisplayOBJ │ │ │ ├── LoadDisplayOBJ.pde │ │ │ └── data │ │ │ │ ├── rocket.mtl │ │ │ │ ├── rocket.obj │ │ │ │ └── rocket.png │ │ ├── LoadDisplaySVG │ │ │ ├── LoadDisplaySVG.pde │ │ │ └── data │ │ │ │ └── bot1.svg │ │ └── ScaleShape │ │ │ ├── ScaleShape.pde │ │ │ └── data │ │ │ └── bot1.svg │ ├── Structure │ │ ├── Coordinates │ │ │ └── Coordinates.pde │ │ ├── CreateGraphics │ │ │ ├── CreateGraphics.pde │ │ │ └── data │ │ │ │ ├── mask.jpg │ │ │ │ └── test.jpg │ │ ├── Functions │ │ │ └── Functions.pde │ │ ├── Loop │ │ │ └── Loop.pde │ │ ├── NoLoop │ │ │ └── NoLoop.pde │ │ ├── Recursion │ │ │ └── Recursion.pde │ │ ├── Recursion2 │ │ │ └── Recursion2.pde │ │ ├── Redraw │ │ │ └── Redraw.pde │ │ ├── SetupDraw │ │ │ └── SetupDraw.pde │ │ ├── StatementsComments │ │ │ └── StatementsComments.pde │ │ └── WidthHeight │ │ │ └── WidthHeight.pde │ ├── Transform │ │ ├── Arm │ │ │ └── Arm.pde │ │ ├── Rotate │ │ │ └── Rotate.pde │ │ ├── RotatePushPop │ │ │ └── RotatePushPop.pde │ │ ├── RotateXY │ │ │ └── RotateXY.pde │ │ ├── Scale │ │ │ └── Scale.pde │ │ ├── Translate │ │ │ └── Translate.pde │ │ └── TriangleFlower │ │ │ └── TriangleFlower.pde │ ├── Typography │ │ ├── Letters │ │ │ ├── Letters.pde │ │ │ └── data │ │ │ │ └── CourierNew36.vlw │ │ └── Words │ │ │ ├── Words.pde │ │ │ └── data │ │ │ └── Ziggurat-HTF-Black-32.vlw │ └── Web │ │ ├── EmbeddedLinks │ │ └── EmbeddedLinks.pde │ │ └── LoadingImages │ │ └── LoadingImages.pde ├── Demos │ ├── Graphics │ │ ├── Particles │ │ │ ├── Particle.pde │ │ │ ├── ParticleSystem.pde │ │ │ ├── Particles.pde │ │ │ └── data │ │ │ │ └── sprite.png │ │ ├── Patch │ │ │ └── Patch.pde │ │ ├── Planets │ │ │ ├── Perlin.pde │ │ │ ├── Planets.pde │ │ │ └── data │ │ │ │ ├── mercury.jpg │ │ │ │ ├── planet.jpg │ │ │ │ ├── starfield.jpg │ │ │ │ └── sun.jpg │ │ ├── Ribbons │ │ │ ├── ArcBall.pde │ │ │ ├── BSpline.pde │ │ │ ├── Geometry.pde │ │ │ ├── PDB.pde │ │ │ ├── Ribbons.pde │ │ │ └── data │ │ │ │ ├── 1CBS.pdb │ │ │ │ ├── 2POR.pdb │ │ │ │ └── 4HHB.pdb │ │ ├── RotatingArcs │ │ │ └── RotatingArcs.pde │ │ ├── Trefoil │ │ │ ├── Surface.pde │ │ │ ├── Trefoil.pde │ │ │ └── data │ │ │ │ └── particle.png │ │ ├── Wiggling │ │ │ └── Wiggling.pde │ │ └── Yellowtail │ │ │ ├── Gesture.pde │ │ │ ├── Polygon.pde │ │ │ ├── Vec3f.pde │ │ │ └── Yellowtail.pde │ ├── Performance │ │ ├── CubicGridImmediate │ │ │ └── CubicGridImmediate.pde │ │ ├── CubicGridRetained │ │ │ └── CubicGridRetained.pde │ │ ├── DynamicParticlesImmediate │ │ │ ├── DynamicParticlesImmediate.pde │ │ │ └── data │ │ │ │ └── sprite.png │ │ ├── DynamicParticlesRetained │ │ │ ├── DynamicParticlesRetained.pde │ │ │ └── data │ │ │ │ └── sprite.png │ │ ├── Esfera │ │ │ └── Esfera.pde │ │ ├── LineRendering │ │ │ └── LineRendering.pde │ │ ├── QuadRendering │ │ │ └── QuadRendering.pde │ │ ├── StaticParticlesImmediate │ │ │ ├── StaticParticlesImmediate.pde │ │ │ └── data │ │ │ │ └── sprite.png │ │ ├── StaticParticlesRetained │ │ │ ├── StaticParticlesRetained.pde │ │ │ └── data │ │ │ │ └── sprite.png │ │ └── TextRendering │ │ │ └── TextRendering.pde │ └── Tests │ │ ├── NoBackgroundTest │ │ └── NoBackgroundTest.pde │ │ ├── OffscreenTest │ │ └── OffscreenTest.pde │ │ └── RedrawTest │ │ └── RedrawTest.pde ├── Sensors │ ├── Accelerometer │ │ ├── Accelerometer.pde │ │ └── AccelerometerManager.java │ └── Compass │ │ ├── Compass.pde │ │ └── CompassManager.java └── Topics │ ├── Advanced Data │ ├── ArrayListClass │ │ ├── ArrayListClass.pde │ │ └── Ball.pde │ ├── DirectoryList │ │ └── DirectoryList.pde │ └── HashMapClass │ │ ├── HashMapClass.pde │ │ ├── Word.pde │ │ └── data │ │ ├── dracula.txt │ │ └── hamlet.txt │ ├── Animation │ ├── AnimatedSprite │ │ ├── AnimatedSprite.pde │ │ ├── Animation.pde │ │ └── data │ │ │ ├── PT_Shifty_0000.gif │ │ │ ├── PT_Shifty_0001.gif │ │ │ ├── PT_Shifty_0002.gif │ │ │ ├── PT_Shifty_0003.gif │ │ │ ├── PT_Shifty_0004.gif │ │ │ ├── PT_Shifty_0005.gif │ │ │ ├── PT_Shifty_0006.gif │ │ │ ├── PT_Shifty_0007.gif │ │ │ ├── PT_Shifty_0008.gif │ │ │ ├── PT_Shifty_0009.gif │ │ │ ├── PT_Shifty_0010.gif │ │ │ ├── PT_Shifty_0011.gif │ │ │ ├── PT_Shifty_0012.gif │ │ │ ├── PT_Shifty_0013.gif │ │ │ ├── PT_Shifty_0014.gif │ │ │ ├── PT_Shifty_0015.gif │ │ │ ├── PT_Shifty_0016.gif │ │ │ ├── PT_Shifty_0017.gif │ │ │ ├── PT_Shifty_0018.gif │ │ │ ├── PT_Shifty_0019.gif │ │ │ ├── PT_Shifty_0020.gif │ │ │ ├── PT_Shifty_0021.gif │ │ │ ├── PT_Shifty_0022.gif │ │ │ ├── PT_Shifty_0023.gif │ │ │ ├── PT_Shifty_0024.gif │ │ │ ├── PT_Shifty_0025.gif │ │ │ ├── PT_Shifty_0026.gif │ │ │ ├── PT_Shifty_0027.gif │ │ │ ├── PT_Shifty_0028.gif │ │ │ ├── PT_Shifty_0029.gif │ │ │ ├── PT_Shifty_0030.gif │ │ │ ├── PT_Shifty_0031.gif │ │ │ ├── PT_Shifty_0032.gif │ │ │ ├── PT_Shifty_0033.gif │ │ │ ├── PT_Shifty_0034.gif │ │ │ ├── PT_Shifty_0035.gif │ │ │ ├── PT_Shifty_0036.gif │ │ │ ├── PT_Shifty_0037.gif │ │ │ ├── PT_Teddy_0000.gif │ │ │ ├── PT_Teddy_0001.gif │ │ │ ├── PT_Teddy_0002.gif │ │ │ ├── PT_Teddy_0003.gif │ │ │ ├── PT_Teddy_0004.gif │ │ │ ├── PT_Teddy_0005.gif │ │ │ ├── PT_Teddy_0006.gif │ │ │ ├── PT_Teddy_0007.gif │ │ │ ├── PT_Teddy_0008.gif │ │ │ ├── PT_Teddy_0009.gif │ │ │ ├── PT_Teddy_0010.gif │ │ │ ├── PT_Teddy_0011.gif │ │ │ ├── PT_Teddy_0012.gif │ │ │ ├── PT_Teddy_0013.gif │ │ │ ├── PT_Teddy_0014.gif │ │ │ ├── PT_Teddy_0015.gif │ │ │ ├── PT_Teddy_0016.gif │ │ │ ├── PT_Teddy_0017.gif │ │ │ ├── PT_Teddy_0018.gif │ │ │ ├── PT_Teddy_0019.gif │ │ │ ├── PT_Teddy_0020.gif │ │ │ ├── PT_Teddy_0021.gif │ │ │ ├── PT_Teddy_0022.gif │ │ │ ├── PT_Teddy_0023.gif │ │ │ ├── PT_Teddy_0024.gif │ │ │ ├── PT_Teddy_0025.gif │ │ │ ├── PT_Teddy_0026.gif │ │ │ ├── PT_Teddy_0027.gif │ │ │ ├── PT_Teddy_0028.gif │ │ │ ├── PT_Teddy_0029.gif │ │ │ ├── PT_Teddy_0030.gif │ │ │ ├── PT_Teddy_0031.gif │ │ │ ├── PT_Teddy_0032.gif │ │ │ ├── PT_Teddy_0033.gif │ │ │ ├── PT_Teddy_0034.gif │ │ │ ├── PT_Teddy_0035.gif │ │ │ ├── PT_Teddy_0036.gif │ │ │ ├── PT_Teddy_0037.gif │ │ │ ├── PT_Teddy_0038.gif │ │ │ ├── PT_Teddy_0039.gif │ │ │ ├── PT_Teddy_0040.gif │ │ │ ├── PT_Teddy_0041.gif │ │ │ ├── PT_Teddy_0042.gif │ │ │ ├── PT_Teddy_0043.gif │ │ │ ├── PT_Teddy_0044.gif │ │ │ ├── PT_Teddy_0045.gif │ │ │ ├── PT_Teddy_0046.gif │ │ │ ├── PT_Teddy_0047.gif │ │ │ ├── PT_Teddy_0048.gif │ │ │ ├── PT_Teddy_0049.gif │ │ │ ├── PT_Teddy_0050.gif │ │ │ ├── PT_Teddy_0051.gif │ │ │ ├── PT_Teddy_0052.gif │ │ │ ├── PT_Teddy_0053.gif │ │ │ ├── PT_Teddy_0054.gif │ │ │ ├── PT_Teddy_0055.gif │ │ │ ├── PT_Teddy_0056.gif │ │ │ ├── PT_Teddy_0057.gif │ │ │ ├── PT_Teddy_0058.gif │ │ │ └── PT_Teddy_0059.gif │ └── Sequential │ │ ├── Sequential.pde │ │ └── data │ │ ├── PT_anim0000.gif │ │ ├── PT_anim0001.gif │ │ ├── PT_anim0002.gif │ │ ├── PT_anim0003.gif │ │ ├── PT_anim0004.gif │ │ ├── PT_anim0005.gif │ │ ├── PT_anim0006.gif │ │ ├── PT_anim0007.gif │ │ ├── PT_anim0008.gif │ │ ├── PT_anim0009.gif │ │ ├── PT_anim0010.gif │ │ └── PT_anim0011.gif │ ├── Cellular Automata │ ├── Conway │ │ └── Conway.pde │ ├── Spore1 │ │ └── Spore1.pde │ ├── Spore2 │ │ └── Spore2.pde │ └── Wolfram │ │ ├── CA.pde │ │ └── Wolfram.pde │ ├── Create Shapes │ ├── BeginEndContour │ │ └── BeginEndContour.pde │ ├── GroupPShape │ │ └── GroupPShape.pde │ ├── ParticleSystemPShape │ │ ├── Particle.pde │ │ ├── ParticleSystem.pde │ │ ├── ParticleSystemPShape.pde │ │ └── data │ │ │ └── sprite.png │ ├── PathPShape │ │ └── PathPShape.pde │ ├── PolygonPShape │ │ └── PolygonPShape.pde │ ├── PolygonPShapeOOP │ │ ├── PolygonPShapeOOP.pde │ │ └── Star.pde │ ├── PolygonPShapeOOP2 │ │ ├── Polygon.pde │ │ └── PolygonPShapeOOP2.pde │ ├── PolygonPShapeOOP3 │ │ ├── Polygon.pde │ │ └── PolygonPShapeOOP3.pde │ ├── PrimitivePShape │ │ └── PrimitivePShape.pde │ └── WigglePShape │ │ ├── WigglePShape.pde │ │ └── Wiggler.pde │ ├── Drawing │ ├── Animator │ │ └── Animator.pde │ ├── ContinuousLines │ │ └── ContinuousLines.pde │ ├── CustomTool │ │ ├── CustomTool.pde │ │ └── data │ │ │ ├── milan.jpg │ │ │ └── paris.jpg │ ├── Pattern │ │ └── Pattern.pde │ ├── Pulses │ │ └── Pulses.pde │ └── ScribblePlotter │ │ └── ScribblePlotter.pde │ ├── Effects │ ├── FireCube │ │ └── FireCube.pde │ ├── Lens │ │ ├── Lens.pde │ │ └── data │ │ │ └── red_smoke.jpg │ ├── Metaball │ │ └── Metaball.pde │ ├── Plasma │ │ └── Plasma.pde │ ├── Tunnel │ │ ├── Tunnel.pde │ │ └── data │ │ │ └── red_smoke.jpg │ ├── UnlimitedSprites │ │ ├── UnlimitedSprites.pde │ │ └── data │ │ │ └── Aqua-Ball-48x48.png │ └── Wormhole │ │ ├── Wormhole.pde │ │ └── data │ │ ├── texture.gif │ │ └── wormhole.png │ ├── File IO │ ├── LoadFile1 │ │ ├── LoadFile1.pde │ │ └── data │ │ │ └── positions.txt │ ├── LoadFile2 │ │ ├── LoadFile2.pde │ │ ├── Record.pde │ │ └── data │ │ │ ├── TheSans-Plain-12.vlw │ │ │ └── cars2.tsv │ ├── SaveFile1 │ │ └── SaveFile1.pde │ ├── SaveFile2 │ │ └── SaveFile2.pde │ ├── SaveManyImages │ │ └── SaveManyImages.pde │ ├── SaveOneImage │ │ └── SaveOneImage.pde │ └── TileImages │ │ └── TileImages.pde │ ├── Fractals and L-Systems │ ├── Koch │ │ └── Koch.pde │ ├── Mandelbrot │ │ └── Mandelbrot.pde │ ├── PenroseSnowflake │ │ ├── LSystem.pde │ │ ├── PenroseSnowflake.pde │ │ └── PenroseSnowflakeLSystem.pde │ ├── PenroseTile │ │ ├── LSystem.pde │ │ ├── PenroseLSystem.pde │ │ └── PenroseTile.pde │ ├── Pentigree │ │ ├── LSystem.pde │ │ ├── Pentigree.pde │ │ └── PentigreeLSystem.pde │ └── Tree │ │ └── Tree.pde │ ├── GUI │ ├── Button │ │ └── Button.pde │ ├── Buttons │ │ └── Buttons.pde │ ├── Handles │ │ └── Handles.pde │ ├── ImageButton │ │ ├── ImageButton.pde │ │ └── data │ │ │ ├── base.gif │ │ │ ├── down.gif │ │ │ └── roll.gif │ ├── Rollover │ │ └── Rollover.pde │ └── Scrollbar │ │ ├── Scrollbar.pde │ │ └── data │ │ ├── seedBottom.jpg │ │ └── seedTop.jpg │ ├── Geometry │ ├── Icosahedra │ │ ├── Dimension3D.pde │ │ ├── Icosahedra.pde │ │ ├── Icosahedron.pde │ │ └── Shape3D.pde │ ├── NoiseSphere │ │ └── NoiseSphere.pde │ ├── RGBCube │ │ └── RGBCube.pde │ ├── ShapeTransform │ │ └── ShapeTransform.pde │ ├── SpaceJunk │ │ ├── Cube.pde │ │ └── SpaceJunk.pde │ ├── Toroid │ │ └── Toroid.pde │ └── Vertices │ │ └── Vertices.pde │ ├── Image Processing │ ├── Blur │ │ ├── Blur.pde │ │ └── data │ │ │ └── trees.jpg │ ├── Brightness │ │ ├── Brightness.pde │ │ └── data │ │ │ └── wires.jpg │ ├── Convolution │ │ ├── Convolution.pde │ │ └── data │ │ │ ├── end.jpg │ │ │ └── sunflower.jpg │ ├── EdgeDetection │ │ ├── EdgeDetection.pde │ │ └── data │ │ │ └── house.jpg │ ├── Histogram │ │ ├── Histogram.pde │ │ └── data │ │ │ ├── cdi01_g.jpg │ │ │ └── ystone08.jpg │ ├── LinearImage │ │ ├── LinearImage.pde │ │ └── data │ │ │ └── florence03.jpg │ └── PixelArray │ │ ├── PixelArray.pde │ │ └── data │ │ └── ystone08.jpg │ ├── Interaction │ ├── Follow1 │ │ └── Follow1.pde │ ├── Follow2 │ │ └── Follow2.pde │ ├── Follow3 │ │ └── Follow3.pde │ ├── Reach1 │ │ └── Reach1.pde │ ├── Reach2 │ │ └── Reach2.pde │ ├── Reach3 │ │ └── Reach3.pde │ └── Tickle │ │ ├── Tickle.pde │ │ └── data │ │ └── AmericanTypewriter-24.vlw │ ├── Motion │ ├── Bounce │ │ └── Bounce.pde │ ├── BouncyBubbles │ │ └── BouncyBubbles.pde │ ├── Brownian │ │ └── Brownian.pde │ ├── CircleCollision │ │ ├── Ball.pde │ │ └── CircleCollision.pde │ ├── Collision │ │ └── Collision.pde │ ├── Linear │ │ └── Linear.pde │ ├── MovingOnCurves │ │ └── MovingOnCurves.pde │ ├── Puff │ │ └── Puff.pde │ ├── Reflection1 │ │ └── Reflection1.pde │ └── Reflection2 │ │ ├── Ground.pde │ │ ├── Orb.pde │ │ └── Reflection2.pde │ ├── Shaders │ ├── BlurFilter │ │ ├── BlurFilter.pde │ │ └── data │ │ │ └── blur.glsl │ ├── EdgeDetect │ │ ├── EdgeDetect.pde │ │ └── data │ │ │ ├── edges.glsl │ │ │ └── leaves.jpg │ ├── EdgeFilter │ │ ├── EdgeFilter.pde │ │ └── data │ │ │ └── edges.glsl │ ├── LowLevelGL │ │ ├── LowLevelGL.pde │ │ └── data │ │ │ ├── frag.glsl │ │ │ └── vert.glsl │ └── ToonShading │ │ ├── ToonShading.pde │ │ └── data │ │ ├── ToonFrag.glsl │ │ └── ToonVert.glsl │ ├── Simulate │ ├── Chain │ │ └── Chain.pde │ ├── Flocking │ │ ├── Boid.pde │ │ ├── Flock.pde │ │ └── Flocking.pde │ ├── ForcesWithVectors │ │ ├── ForcesWithVectors.pde │ │ ├── Liquid.pde │ │ └── Mover.pde │ ├── GravitationalAttraction3D │ │ ├── GravitationalAttraction3D.pde │ │ ├── Planet.pde │ │ └── Sun.pde │ ├── MultipleParticleSystems │ │ ├── CrazyParticle.pde │ │ ├── MultipleParticleSystems.pde │ │ ├── Particle.pde │ │ └── ParticleSystem.pde │ ├── SimpleParticleSystem │ │ ├── Particle.pde │ │ ├── ParticleSystem.pde │ │ └── SimpleParticleSystem.pde │ ├── SmokeParticleSystem │ │ ├── Particle.pde │ │ ├── ParticleSystem.pde │ │ ├── SmokeParticleSystem.pde │ │ └── data │ │ │ ├── texture.gif │ │ │ └── texture.png │ ├── SoftBody │ │ └── SoftBody.pde │ ├── Spring │ │ └── Spring.pde │ └── Springs │ │ └── Springs.pde │ ├── Textures │ ├── TextureCube │ │ ├── TextureCube.pde │ │ └── data │ │ │ ├── berlin-1.jpg │ │ │ └── uvtex.jpg │ ├── TextureCylinder │ │ ├── TextureCylinder.pde │ │ └── data │ │ │ └── berlin-1.jpg │ ├── TextureQuad │ │ ├── TextureQuad.pde │ │ └── data │ │ │ └── berlin-1.jpg │ ├── TextureSphere │ │ ├── TextureSphere.pde │ │ └── data │ │ │ └── world32k.jpg │ └── TextureTriangle │ │ ├── TextureTriangle.pde │ │ └── data │ │ └── berlin-1.jpg │ └── Vectors │ ├── AccelerationWithVectors │ ├── AccelerationWithVectors.pde │ └── Mover.pde │ ├── BouncingBall │ └── BouncingBall.pde │ ├── Normalize │ └── Normalize.pde │ └── VectorMath │ └── VectorMath.pde ├── icons ├── icon-36.png ├── icon-48.png ├── icon-72.png └── icon-96.png ├── mode.properties ├── mode └── .gitignore ├── processing-android ├── src └── processing │ └── mode │ └── android │ ├── AVD.java │ ├── AndroidBuild.java │ ├── AndroidEditor.java │ ├── AndroidKeyStore.java │ ├── AndroidMode.java │ ├── AndroidPreprocessor.java │ ├── AndroidRunner.java │ ├── AndroidSDK.java │ ├── AndroidToolbar.java │ ├── BadSDKException.java │ ├── Commander.java │ ├── Device.java │ ├── DeviceListener.java │ ├── Devices.java │ ├── EmulatorController.java │ ├── Export.java │ ├── KeyStoreManager.java │ ├── Keys.java │ ├── LogEntry.java │ ├── Manifest.java │ ├── Permissions.java │ ├── SDKDownloader.java │ └── signing │ ├── IApkSignatureProvider.java │ ├── JarSigner.java │ └── SignedJarBuilder.java ├── theme ├── completion │ ├── class_obj-1x.png │ ├── class_obj-2x.png │ ├── field_default_obj-1x.png │ ├── field_default_obj-2x.png │ ├── field_protected_obj-1x.png │ ├── field_protected_obj-2x.png │ ├── methpub_obj-1x.png │ └── methpub_obj-2x.png ├── debug │ ├── breakpoint-enabled-1x.png │ ├── breakpoint-enabled-2x.png │ ├── continue-enabled-1x.png │ ├── continue-enabled-2x.png │ ├── step-enabled-1x.png │ └── step-enabled-2x.png ├── variables-1x.png └── variables-2x.png └── todo.txt /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | bin 2 | android-core.zip 3 | release 4 | 5 | .AppleDouble 6 | ._* 7 | *~ 8 | .DS_Store -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | android-mode 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.jdt.core.javanature 16 | 17 | 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Processing for Android 2 | ====================== 3 | 4 | Repository for all Android-related development for Processing. 5 | 6 | We've moved this out from the main project so that it won't hamper progress on the desktop side, and in the hope that others will be more inclined to help and contribute on this isolated portion of the project. 7 | 8 | This is primarily the source for the Android Mode, with the 'core' library found inside a subfolder of the same name. 9 | 10 | Please, please help us keep this code up to date and debugged by making fixes and submitting your pull requests here. The entire Processing project is developed by a tiny number of people working during their free time, and we could really use the help. 11 | 12 | Ben Fry 13 | 21 April 2013 14 | -------------------------------------------------------------------------------- /core/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /core/.gitignore: -------------------------------------------------------------------------------- 1 | bin 2 | 3 | -------------------------------------------------------------------------------- /core/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | android-core 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.jdt.core.javanature 16 | 17 | 18 | -------------------------------------------------------------------------------- /core/src/processing/data/Sort.java: -------------------------------------------------------------------------------- 1 | package processing.data; 2 | 3 | 4 | /** 5 | * Internal sorter used by several data classes. 6 | * Advanced users only, not official API. 7 | */ 8 | public abstract class Sort implements Runnable { 9 | 10 | public Sort() { } 11 | 12 | 13 | public void run() { 14 | int c = size(); 15 | if (c > 1) { 16 | sort(0, c - 1); 17 | } 18 | } 19 | 20 | 21 | protected void sort(int i, int j) { 22 | int pivotIndex = (i+j)/2; 23 | swap(pivotIndex, j); 24 | int k = partition(i-1, j); 25 | swap(k, j); 26 | if ((k-i) > 1) sort(i, k-1); 27 | if ((j-k) > 1) sort(k+1, j); 28 | } 29 | 30 | 31 | protected int partition(int left, int right) { 32 | int pivot = right; 33 | do { 34 | while (compare(++left, pivot) < 0) ; 35 | while ((right != 0) && (compare(--right, pivot) > 0)) ; 36 | swap(left, right); 37 | } while (left < right); 38 | swap(left, right); 39 | return left; 40 | } 41 | 42 | 43 | abstract public int size(); 44 | abstract public float compare(int a, int b); 45 | abstract public void swap(int a, int b); 46 | } -------------------------------------------------------------------------------- /core/src/processing/opengl/shaders/ColorFrag.glsl: -------------------------------------------------------------------------------- 1 | /* 2 | Part of the Processing project - http://processing.org 3 | 4 | Copyright (c) 2012-15 The Processing Foundation 5 | Copyright (c) 2004-12 Ben Fry and Casey Reas 6 | Copyright (c) 2001-04 Massachusetts Institute of Technology 7 | 8 | This library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU Lesser General Public 10 | License as published by the Free Software Foundation, version 2.1. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General 18 | Public License along with this library; if not, write to the 19 | Free Software Foundation, Inc., 59 Temple Place, Suite 330, 20 | Boston, MA 02111-1307 USA 21 | */ 22 | 23 | #ifdef GL_ES 24 | precision mediump float; 25 | precision mediump int; 26 | #endif 27 | 28 | varying vec4 vertColor; 29 | 30 | void main() { 31 | gl_FragColor = vertColor; 32 | } -------------------------------------------------------------------------------- /core/src/processing/opengl/shaders/ColorVert.glsl: -------------------------------------------------------------------------------- 1 | /* 2 | Part of the Processing project - http://processing.org 3 | 4 | Copyright (c) 2012-15 The Processing Foundation 5 | Copyright (c) 2004-12 Ben Fry and Casey Reas 6 | Copyright (c) 2001-04 Massachusetts Institute of Technology 7 | 8 | This library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU Lesser General Public 10 | License as published by the Free Software Foundation, version 2.1. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General 18 | Public License along with this library; if not, write to the 19 | Free Software Foundation, Inc., 59 Temple Place, Suite 330, 20 | Boston, MA 02111-1307 USA 21 | */ 22 | 23 | uniform mat4 transformMatrix; 24 | 25 | attribute vec4 position; 26 | attribute vec4 color; 27 | 28 | varying vec4 vertColor; 29 | 30 | void main() { 31 | gl_Position = transformMatrix * position; 32 | 33 | vertColor = color; 34 | } -------------------------------------------------------------------------------- /core/src/processing/opengl/shaders/LineFrag.glsl: -------------------------------------------------------------------------------- 1 | /* 2 | Part of the Processing project - http://processing.org 3 | 4 | Copyright (c) 2012-15 The Processing Foundation 5 | Copyright (c) 2004-12 Ben Fry and Casey Reas 6 | Copyright (c) 2001-04 Massachusetts Institute of Technology 7 | 8 | This library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU Lesser General Public 10 | License as published by the Free Software Foundation, version 2.1. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General 18 | Public License along with this library; if not, write to the 19 | Free Software Foundation, Inc., 59 Temple Place, Suite 330, 20 | Boston, MA 02111-1307 USA 21 | */ 22 | 23 | #ifdef GL_ES 24 | precision mediump float; 25 | precision mediump int; 26 | #endif 27 | 28 | varying vec4 vertColor; 29 | 30 | void main() { 31 | gl_FragColor = vertColor; 32 | } -------------------------------------------------------------------------------- /core/src/processing/opengl/shaders/PointFrag.glsl: -------------------------------------------------------------------------------- 1 | /* 2 | Part of the Processing project - http://processing.org 3 | 4 | Copyright (c) 2012-15 The Processing Foundation 5 | Copyright (c) 2004-12 Ben Fry and Casey Reas 6 | Copyright (c) 2001-04 Massachusetts Institute of Technology 7 | 8 | This library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU Lesser General Public 10 | License as published by the Free Software Foundation, version 2.1. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General 18 | Public License along with this library; if not, write to the 19 | Free Software Foundation, Inc., 59 Temple Place, Suite 330, 20 | Boston, MA 02111-1307 USA 21 | */ 22 | 23 | #ifdef GL_ES 24 | precision mediump float; 25 | precision mediump int; 26 | #endif 27 | 28 | varying vec4 vertColor; 29 | 30 | void main() { 31 | gl_FragColor = vertColor; 32 | } -------------------------------------------------------------------------------- /examples/Basics/Arrays/Array/Array.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Array. 3 | * 4 | * An array is a list of data. Each piece of data in an array 5 | * is identified by an index number representing its position in 6 | * the array. Arrays are zero based, which means that the first 7 | * element in the array is [0], the second element is [1], and so on. 8 | * In this example, an array named "coswav" is created and 9 | * filled with the cosine values. This data is displayed three 10 | * separate ways on the screen. 11 | */ 12 | 13 | size(200, 200); 14 | 15 | float[] coswave = new float[width]; 16 | 17 | for (int i = 0; i < width; i++) { 18 | float amount = map(i, 0, width, 0, PI); 19 | coswave[i] = abs(cos(amount)); 20 | } 21 | 22 | for (int i = 0; i < width; i++) { 23 | stroke(coswave[i]*255); 24 | line(i, 0, i, height/3); 25 | } 26 | 27 | for (int i = 0; i < width; i++) { 28 | stroke(coswave[i]*255 / 4); 29 | line(i, height/3, i, height/3*2); 30 | } 31 | 32 | for (int i = 0; i < width; i++) { 33 | stroke(255 - coswave[i]*255); 34 | line(i, height/3*2, i, height); 35 | } 36 | -------------------------------------------------------------------------------- /examples/Basics/Arrays/Array2D/Array2D.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Array 2D. 3 | * 4 | * Demonstrates the syntax for creating a two-dimensional (2D) array. 5 | * Values in a 2D array are accessed through two index values. 6 | * 2D arrays are useful for storing images. In this example, each dot 7 | * is colored in relation to its distance from the center of the image. 8 | */ 9 | 10 | float[][] distances; 11 | float maxDistance; 12 | 13 | size(200, 200); 14 | background(0); 15 | maxDistance = dist(width/2, height/2, width, height); 16 | distances = new float[width][height]; 17 | for(int i=0; i= big || x <= 0) { 23 | xdir *= -1; 24 | x = x + (1 * xdir); 25 | y = y + (1 * ydir); 26 | } 27 | if (y >= big || y <= 0) { 28 | ydir *= -1; 29 | y = y + (1 * ydir); 30 | } 31 | } 32 | 33 | // Custom method for drawing the object 34 | void draw() { 35 | stroke(second() * 4); 36 | point(mx+x-1, my+y-1); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /examples/Basics/Camera/MoveEye/MoveEye.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Move Eye. 3 | * by Simon Greenwold. 4 | * 5 | * The camera lifts up (controlled by mouseY) while looking at the same point. 6 | */ 7 | 8 | void setup() { 9 | size(640, 360, P3D); 10 | orientation(LANDSCAPE); 11 | fill(204); 12 | } 13 | 14 | void draw() { 15 | lights(); 16 | background(0); 17 | 18 | // Change height of the camera with mouseY 19 | camera(30.0, mouseY, 220.0, // eyeX, eyeY, eyeZ 20 | 0.0, 0.0, 0.0, // centerX, centerY, centerZ 21 | 0.0, 1.0, 0.0); // upX, upY, upZ 22 | 23 | noStroke(); 24 | box(90); 25 | stroke(255); 26 | line(-100, 0, 0, 100, 0, 0); 27 | line(0, -100, 0, 0, 100, 0); 28 | line(0, 0, -100, 0, 0, 100); 29 | } 30 | -------------------------------------------------------------------------------- /examples/Basics/Color/Brightness/Brightness.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Brightness 3 | * by Rusty Robison. 4 | * 5 | * Brightness is the relative lightness or darkness of a color. 6 | * Move the cursor vertically over each bar to alter its brightness. 7 | * 8 | * Updated 28 February 2010. 9 | */ 10 | 11 | int barWidth = 5; 12 | int lastBar = -1; 13 | 14 | void setup() { 15 | size(200, 200); 16 | colorMode(HSB, 360, 100, height); 17 | noStroke(); 18 | background(0); 19 | } 20 | 21 | void draw() { 22 | int whichBar = mouseX / barWidth; 23 | if (whichBar != lastBar) { 24 | int barX = whichBar * barWidth; 25 | fill(barX, 100, mouseY); 26 | rect(barX, 0, barWidth, height); 27 | lastBar = whichBar; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /examples/Basics/Color/Creating/Creating.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Creating Colors (Homage to Albers). 3 | * 4 | * Creating variables for colors that may be referred to 5 | * in the program by their name, rather than a number. 6 | */ 7 | 8 | size(200, 200); 9 | noStroke(); 10 | 11 | color inside = color(204, 102, 0); 12 | color middle = color(204, 153, 0); 13 | color outside = color(153, 51, 0); 14 | 15 | // These statements are equivalent to the statements above. 16 | // Programmers may use the format they prefer. 17 | //color inside = #CC6600; 18 | //color middle = #CC9900; 19 | //color outside = #993300; 20 | 21 | fill(outside); 22 | rect(0, 0, 200, 200); 23 | fill(middle); 24 | rect(40, 60, 120, 120); 25 | fill(inside); 26 | rect(60, 90, 80, 80); 27 | -------------------------------------------------------------------------------- /examples/Basics/Color/Hue/Hue.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Hue. 3 | * 4 | * Hue is the color reflected from or transmitted through an object 5 | * and is typically referred to as the name of the color (red, blue, yellow, etc.) 6 | * Move the cursor vertically over each bar to alter its hue. 7 | */ 8 | 9 | int barWidth = 5; 10 | int[] hue; 11 | 12 | void setup() 13 | { 14 | size(200, 200); 15 | colorMode(HSB, 360, height, height); 16 | hue = new int[width/barWidth]; 17 | noStroke(); 18 | } 19 | 20 | void draw() 21 | { 22 | int j = 0; 23 | for (int i=0; i<=(width-barWidth); i+=barWidth) { 24 | if ((mouseX > i) && (mouseX < i+barWidth)) { 25 | hue[j] = mouseY; 26 | } 27 | fill(hue[j], height/1.2, height/1.2); 28 | rect(i, 0, barWidth, height); 29 | j++; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /examples/Basics/Color/RadialGradient2/RadialGradient2.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Inspired by Ira Greenberg's RadialGradient sketch, 3 | * but uses a different method for the gradients. 4 | */ 5 | 6 | int dim = 40; 7 | 8 | void setup() { 9 | size(200, 200); 10 | background(0); 11 | smooth(); 12 | noStroke(); 13 | ellipseMode(RADIUS); 14 | 15 | // create a simple table of gradients 16 | int rows = height / dim; 17 | int cols = width / dim; 18 | 19 | for (int row = 0; row < rows; row++) { 20 | for (int col = 0; col < cols; col++) { 21 | drawGradient(col*dim + dim/2, row*dim + dim/2); 22 | } 23 | } 24 | } 25 | 26 | void drawGradient(float x, float y) { 27 | int radius = dim/2 - 2; 28 | float r1 = random(255); 29 | float g1 = random(255); 30 | float b1 = random(255); 31 | float dr = (random(255) - r1) / radius; 32 | float dg = (random(255) - g1) / radius; 33 | float db = (random(255) - b1) / radius; 34 | 35 | for (int r = radius; r > 0; --r) { 36 | fill(r1, g1, b1); 37 | ellipse(x, y, r, r); 38 | r1 += dr; 39 | g1 += dg; 40 | b1 += db; 41 | } 42 | } 43 | 44 | -------------------------------------------------------------------------------- /examples/Basics/Color/Reading/data/cait.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Basics/Color/Reading/data/cait.jpg -------------------------------------------------------------------------------- /examples/Basics/Color/Relativity/Relativity.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Relativity. 3 | * 4 | * Each color is perceived in relation to other colors. 5 | * The top and bottom bars each contain the same component colors, 6 | * but a different display order causes individual colors to appear differently. 7 | */ 8 | 9 | color a, b, c, d, e; 10 | 11 | void setup() { 12 | size(200, 200); 13 | noStroke(); 14 | a = color(165, 167, 20); 15 | b = color(77, 86, 59); 16 | c = color(42, 106, 105); 17 | d = color(165, 89, 20); 18 | e = color(146, 150, 127); 19 | noLoop(); 20 | } 21 | 22 | void draw() { 23 | drawBand(a, b, c, d, e, 0, width/50); 24 | drawBand(c, a, d, b, e, height/2, width/50); 25 | } 26 | 27 | void drawBand(color v, color w, color x, color y, color z, int ypos, int barWidth) { 28 | int num = 5; 29 | color[] colorOrder = { v, w, x, y, z }; 30 | for(int i = 0; i < width; i += barWidth*num) { 31 | for(int j = 0; j < num; j++) { 32 | fill(colorOrder[j]); 33 | rect(i+j*barWidth, ypos, barWidth, height/2); 34 | } 35 | } 36 | } 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /examples/Basics/Color/Saturation/Saturation.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Saturation. 3 | * 4 | * Saturation is the strength or purity of the color and represents the 5 | * amount of gray in proportion to the hue. A "saturated" color is pure 6 | * and an "unsaturated" color has a large percentage of gray. 7 | * Move the cursor vertically over each bar to alter its saturation. 8 | */ 9 | 10 | int barWidth = 5; 11 | int lastBar = -1; 12 | 13 | 14 | void setup() { 15 | size(200, 200); 16 | colorMode(HSB, width, height, 100); 17 | noStroke(); 18 | } 19 | 20 | 21 | void draw() { 22 | int whichBar = mouseX / barWidth; 23 | if (whichBar != lastBar) { 24 | int barX = whichBar * barWidth; 25 | fill(barX, mouseY, 66); 26 | rect(barX, 0, barWidth, height); 27 | lastBar = whichBar; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /examples/Basics/Color/WaveGradient/WaveGradient.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Wave Gradient 3 | * by Ira Greenberg. 4 | * 5 | * Generate a gradient along a sin() wave. 6 | */ 7 | 8 | float angle = 0; 9 | float px = 0, py = 0; 10 | float amplitude = 30; 11 | float frequency = 0; 12 | float fillGap = 2.5; 13 | color c; 14 | 15 | void setup() { 16 | size(200, 200); 17 | background(200,200,200); 18 | noLoop(); 19 | } 20 | 21 | void draw() { 22 | for (int i =- 75; i < height+75; i++){ 23 | // Reset angle to 0, so waves stack properly 24 | angle = 0; 25 | // Increasing frequency causes more gaps 26 | frequency+=.006; 27 | for (float j=0; j 0){ 19 | for(int j = margin; j < width-margin; j+= box_space){ 20 | fill(255-box_size*10); 21 | rect(j, i, box_size, box_size); 22 | } 23 | box_size = box_size - 0.6; 24 | } 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /examples/Basics/Control/Iteration/Iteration.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Iteration. 3 | * 4 | * Iteration with a "for" structure constructs repetitive forms. 5 | */ 6 | 7 | int k; 8 | int xpos1 = 100; 9 | int xpos2 = 118; 10 | int count = 0; 11 | int timey = 0; 12 | int num = 12; 13 | 14 | size(200, 200); 15 | background(102); 16 | noStroke(); 17 | 18 | // Draw gray bars 19 | fill(255); 20 | k=60; 21 | for(int i=0; i < num/3; i++) { 22 | rect(25, k, 155, 5); 23 | k+=10; 24 | } 25 | 26 | // Black bars 27 | fill(51); 28 | k = 40; 29 | for(int i=0; i < num; i++) { 30 | rect(105, k, 30, 5); 31 | k += 10; 32 | } 33 | k = 15; 34 | for(int i = 0; i < num; i++) { 35 | rect(125, k, 30, 5); 36 | k +=10; 37 | } 38 | 39 | // Thin lines 40 | k = 42; 41 | fill(0); 42 | for(int i=0; i < num-1; i++) { 43 | rect(36, k, 20, 1); 44 | k+=10; 45 | } 46 | -------------------------------------------------------------------------------- /examples/Basics/Control/LogicalOperators/LogicalOperators.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Logical Operators. 3 | * 4 | * The logical operators for AND (&&) and OR (||) are used to 5 | * combine simple relational statements into more complex expressions. 6 | * The NOT (!) operator is used to negate a boolean statement. 7 | */ 8 | 9 | size(200, 200); 10 | background(126); 11 | 12 | boolean op = false; 13 | 14 | for(int i=5; i<=195; i+=5) { 15 | // Logical AND 16 | stroke(0); 17 | if((i > 35) && (i < 100)) { 18 | line(5, i, 95, i); 19 | op = false; 20 | } 21 | 22 | // Logical OR 23 | stroke(76); 24 | if((i <= 35) || (i >= 100)) { 25 | line(105, i, 195, i); 26 | op = true; 27 | } 28 | 29 | // Testing if a boolean value is "true" 30 | // The expression "if(op)" is equivalent to "if(op == true)" 31 | if(op) { 32 | stroke(0); 33 | point(width/2, i); 34 | } 35 | 36 | // Testing if a boolean value is "false" 37 | // The expression "if(!op)" is equivalent to "if(op == false)" 38 | if(!op) { 39 | stroke(255); 40 | point(width/4, i); 41 | } 42 | } 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /examples/Basics/Data/CharactersStrings/data/Eureka-90.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Basics/Data/CharactersStrings/data/Eureka-90.vlw -------------------------------------------------------------------------------- /examples/Basics/Data/CharactersStrings/data/rathausFrog.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Basics/Data/CharactersStrings/data/rathausFrog.jpg -------------------------------------------------------------------------------- /examples/Basics/Data/DatatypeConversion/DatatypeConversion.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Datatype Conversion. 3 | * 4 | * It is sometimes beneficial to convert a value from one type of 5 | * data to another. Each of the conversion functions converts its parameter 6 | * to an equivalent representation within its datatype. 7 | * The conversion functions include int(), float(), char(), byte(), and others. 8 | */ 9 | 10 | size(200, 200); 11 | background(51); 12 | noStroke(); 13 | 14 | char c; // Chars are used for storing typographic symbols 15 | float f; // Floats are decimal numbers 16 | int i; // Ints are values between 2,147,483,647 and -2147483648 17 | byte b; // Bytes are values between -128 and 128 18 | 19 | c = 'A'; 20 | f = float(c); // Sets f = 65.0 21 | i = int(f * 1.4); // Sets i to 91 22 | b = byte(c / 2); // Sets b to 32 23 | 24 | rect(f, 0, 40, 66); 25 | fill(204); 26 | rect(i, 67, 40, 66); 27 | fill(255); 28 | rect(b, 134, 40, 66); 29 | -------------------------------------------------------------------------------- /examples/Basics/Data/IntegersFloats/IntegersFloats.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Integers Floats. 3 | * 4 | * Integers and floats are two different kinds of numerical data. 5 | * An integer (more commonly called an int) is a number without 6 | * a decimal point. A float is a floating-point number, which means 7 | * it is a number that has a decimal place. Floats are used when 8 | * more precision is needed. 9 | */ 10 | 11 | int a = 0; // Create a variable "a" of the datatype "int" 12 | float b = 0.0; // Create a variable "b" of the datatype "float" 13 | 14 | void setup() 15 | { 16 | size(200, 200); 17 | stroke(255); 18 | frameRate(30); 19 | } 20 | 21 | void draw() 22 | { 23 | background(51); 24 | 25 | a = a + 1; 26 | b = b + 0.2; 27 | line(a, 0, a, height/2); 28 | line(b, height/2, b, height); 29 | 30 | if(a > width) { 31 | a = 0; 32 | } 33 | if(b > width) { 34 | b = 0; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /examples/Basics/Data/TrueFalse/TrueFalse.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * True/False. 3 | * 4 | * Boolean data is one bit of information. True or false. 5 | * It is common to use Booleans with control statements to 6 | * determine the flow of a program. In this example, when the 7 | * boolean value "x" is true, vertical black lines are drawn and when 8 | * the boolean value "x" is false, horizontal gray lines are drawn. 9 | */ 10 | 11 | boolean x = false; 12 | 13 | size(200, 200); 14 | background(0); 15 | stroke(0); 16 | 17 | for (int i = 1; i < width; i += 2) 18 | { 19 | if (i < width/2) { 20 | x = true; 21 | } else { 22 | x = false; 23 | } 24 | 25 | if (x) { 26 | stroke(255); 27 | line(i, 1, i, height-1); 28 | } 29 | 30 | if (!x) { 31 | stroke(126); 32 | line(width/2 , i, width-2, i); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /examples/Basics/Data/Variables/Variables.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Variables. 3 | * 4 | * Variables are used for storing values. In this example, changing 5 | * the values of variables 'a' and 'b' significantly change the composition. 6 | */ 7 | 8 | size(200, 200); 9 | background(0); 10 | stroke(153); 11 | 12 | int a = 20; 13 | int b = 50; 14 | int c = a*8; 15 | int d = a*9; 16 | int e = b-a; 17 | int f = b*2; 18 | int g = f+e; 19 | 20 | line(a, f, b, g); 21 | line(b, e, b, g); 22 | line(b, e, d, c); 23 | line(a, e, d-e, c); 24 | -------------------------------------------------------------------------------- /examples/Basics/Form/Bezier/Bezier.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Bezier. 3 | * 4 | * The first two parameters for the bezier() function specify the 5 | * first point in the curve and the last two parameters specify 6 | * the last point. The middle parameters set the control points 7 | * that define the shape of the curve. 8 | */ 9 | 10 | size(200, 200); 11 | background(0); 12 | stroke(255); 13 | noFill(); 14 | smooth(); 15 | 16 | for(int i = 0; i < 100; i += 20) { 17 | bezier(90-(i/2.0), 20+i, 210, 10, 220, 150, 120-(i/8.0), 150+(i/4.0)); 18 | } 19 | -------------------------------------------------------------------------------- /examples/Basics/Form/PieChart/PieChart.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Pie Chart 3 | * By Ira Greenberg 4 | * 5 | * Uses the arc() function to generate a pie chart from the data 6 | * stored in an array. 7 | */ 8 | 9 | size(200, 200); 10 | background(100); 11 | smooth(); 12 | noStroke(); 13 | 14 | float diameter = min(width, height) * 0.75; 15 | int[] angs = {30, 10, 45, 35, 60, 38, 75, 67}; 16 | float lastAng = 0; 17 | 18 | for (int i = 0; i < angs.length; i++){ 19 | fill(angs[i] * 3.0); 20 | arc(width/2, height/2, diameter, diameter, lastAng, lastAng+radians(angs[i])); 21 | lastAng += radians(angs[i]); 22 | } 23 | 24 | -------------------------------------------------------------------------------- /examples/Basics/Form/PointsLines/PointsLines.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Points and Lines. 3 | * 4 | * Constructing a simple dimensional form with lines and rectangles. 5 | * Changing the value of the variable 'd' scales the image. 6 | * The four variables set the positions based on the value of 'd'. 7 | */ 8 | 9 | int d = 40; 10 | int p1 = d; 11 | int p2 = p1+d; 12 | int p3 = p2+d; 13 | int p4 = p3+d; 14 | 15 | size(200, 200); 16 | background(0); 17 | 18 | // Draw gray box 19 | stroke(153); 20 | line(p3, p3, p2, p3); 21 | line(p2, p3, p2, p2); 22 | line(p2, p2, p3, p2); 23 | line(p3, p2, p3, p3); 24 | 25 | // Draw white points 26 | stroke(255); 27 | point(p1, p1); 28 | point(p1, p3); 29 | point(p2, p4); 30 | point(p3, p1); 31 | point(p4, p2); 32 | point(p4, p4); 33 | -------------------------------------------------------------------------------- /examples/Basics/Form/Primitives3D/Primitives3D.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Primitives 3D. 3 | * 4 | * Placing mathematically 3D objects in synthetic space. 5 | * The lights() method reveals their imagined dimension. 6 | * The box() and sphere() functions each have one parameter 7 | * which is used to specify their size. These shapes are 8 | * positioned using the translate() function. 9 | */ 10 | 11 | size(640, 360, P3D); 12 | orientation(LANDSCAPE); 13 | background(0); 14 | lights(); 15 | 16 | noStroke(); 17 | pushMatrix(); 18 | translate(130, height/2, 0); 19 | rotateY(1.25); 20 | rotateX(-0.4); 21 | box(100); 22 | popMatrix(); 23 | 24 | noFill(); 25 | stroke(255); 26 | pushMatrix(); 27 | translate(500, height*0.35, -200); 28 | sphere(280); 29 | popMatrix(); 30 | 31 | 32 | -------------------------------------------------------------------------------- /examples/Basics/Form/ShapePrimitives/ShapePrimitives.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Shape Primitives. 3 | * 4 | * The basic shape primitive functions are triangle(), 5 | * rect(), quad(), and ellipse(). Squares are made 6 | * with rect() and circles are made with 7 | * ellipse(). Each of these functions requires a number 8 | * of parameters to determine the shape's position and size. 9 | */ 10 | 11 | size(200, 200); 12 | smooth(); 13 | background(0); 14 | noStroke(); 15 | fill(226); 16 | triangle(10, 10, 10, 200, 45, 200); 17 | rect(45, 45, 35, 35); 18 | quad(105, 10, 120, 10, 120, 200, 80, 200); 19 | ellipse(140, 80, 40, 40); 20 | triangle(160, 10, 195, 200, 160, 200); 21 | 22 | -------------------------------------------------------------------------------- /examples/Basics/Form/TriangleStrip/TriangleStrip.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * TRIANGLE_STRIP Mode 3 | * by Ira Greenberg. 4 | * 5 | * Generate a closed ring using vertex() 6 | * function and beginShape(TRIANGLE_STRIP) 7 | * mode. outerRad and innerRad variables 8 | * control ring's outer/inner radii respectively. 9 | * Trig functions generate ring. 10 | */ 11 | 12 | size(200, 200); 13 | background(204); 14 | smooth(); 15 | 16 | int x = width/2; 17 | int y = height/2; 18 | float outerRad = min(width, height) * 0.4; 19 | float innerRad = outerRad * 0.6; 20 | float px = 0, py = 0, angle = 0; 21 | float pts = 36; 22 | float rot = 360.0/pts; 23 | 24 | beginShape(TRIANGLE_STRIP); 25 | for (int i = 0; i < pts; i++) { 26 | px = x + cos(radians(angle))*outerRad; 27 | py = y + sin(radians(angle))*outerRad; 28 | angle += rot; 29 | vertex(px, py); 30 | px = x + cos(radians(angle))*innerRad; 31 | py = y + sin(radians(angle))*innerRad; 32 | vertex(px, py); 33 | angle += rot; 34 | } 35 | endShape(); 36 | 37 | -------------------------------------------------------------------------------- /examples/Basics/Form/Vertices/Vertices.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Vertices. 3 | * 4 | * The beginShape() function begins recording vertices 5 | * for a shape and endShape() stops recording. 6 | * A vertex is a location in space specified by X, Y, 7 | * and sometimes Z coordinates. After calling the beginShape() function, 8 | * a series of vertex() functions must follow. 9 | * To stop drawing the shape, call the endShape() functions. 10 | */ 11 | 12 | size(200, 200); 13 | background(0); 14 | noFill(); 15 | 16 | stroke(102); 17 | beginShape(); 18 | curveVertex(168, 182); 19 | curveVertex(168, 182); 20 | curveVertex(136, 38); 21 | curveVertex(42, 34); 22 | curveVertex(64, 200); 23 | curveVertex(64, 200); 24 | endShape(); 25 | 26 | stroke(51); 27 | beginShape(LINES); 28 | vertex(60, 40); 29 | vertex(160, 10); 30 | vertex(170, 150); 31 | vertex(60, 150); 32 | endShape(); 33 | 34 | stroke(126); 35 | beginShape(); 36 | vertex(60, 40); 37 | bezierVertex(160, 10, 170, 150, 60, 150); 38 | endShape(); 39 | 40 | stroke(255); 41 | beginShape(POINTS); 42 | vertex(60, 40); 43 | vertex(160, 10); 44 | vertex(170, 150); 45 | vertex(60, 150); 46 | endShape(); 47 | 48 | -------------------------------------------------------------------------------- /examples/Basics/Image/Alphamask/Alphamask.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Alpha Mask. 3 | * 4 | * Loads a "mask" for an image to specify the transparency 5 | * in different parts of the image. The two images are blended 6 | * together using the mask() method of PImage. 7 | */ 8 | 9 | PImage img; 10 | PImage maskImg; 11 | 12 | void setup() { 13 | size(200, 200); 14 | img = loadImage("test.jpg"); 15 | maskImg = loadImage("mask.jpg"); 16 | img.mask(maskImg); 17 | imageMode(CENTER); 18 | } 19 | 20 | void draw() { 21 | background(map(mouseX+mouseY, 0, width+height, 0, 255)); 22 | image(img, width/2, height/2); 23 | image(img, mouseX, mouseY); 24 | } 25 | -------------------------------------------------------------------------------- /examples/Basics/Image/Alphamask/data/mask.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Basics/Image/Alphamask/data/mask.jpg -------------------------------------------------------------------------------- /examples/Basics/Image/Alphamask/data/test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Basics/Image/Alphamask/data/test.jpg -------------------------------------------------------------------------------- /examples/Basics/Image/BackgroundImage/BackgroundImage.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Background Image. 3 | * 4 | * This example presents the fastest way to load a background image 5 | * into Processing. To load an image as the background, it must be 6 | * the same width and height as the program. 7 | */ 8 | 9 | PImage bg; 10 | int a; 11 | 12 | void setup() 13 | { 14 | size(200,200); 15 | frameRate(30); 16 | // The background image must be the same size as the parameters 17 | // into the size() method. In this program, the size of "milan_rubbish.jpg" 18 | // is 200 x 200 pixels. 19 | bg = loadImage("milan_rubbish.jpg"); 20 | } 21 | 22 | void draw() 23 | { 24 | background(bg); 25 | 26 | a = (a + 1)%(width+32); 27 | stroke(226, 204, 0); 28 | line(0, a, width, a-26); 29 | line(0, a-6, width, a-32); 30 | } 31 | -------------------------------------------------------------------------------- /examples/Basics/Image/BackgroundImage/data/milan_rubbish.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Basics/Image/BackgroundImage/data/milan_rubbish.jpg -------------------------------------------------------------------------------- /examples/Basics/Image/CreateImage/CreateImage.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Create Image. 3 | * 4 | * The createImage() function provides a fresh buffer of pixels to play with. 5 | * This example creates an image gradient. 6 | */ 7 | 8 | PImage img; 9 | 10 | void setup() 11 | { 12 | size(200, 200); 13 | img = createImage(120, 120, ARGB); 14 | for(int i=0; i < img.pixels.length; i++) { 15 | img.pixels[i] = color(0, 90, 102, i%img.width * 2); 16 | } 17 | } 18 | 19 | void draw() 20 | { 21 | background(204); 22 | image(img, 33, 33); 23 | image(img, mouseX-60, mouseY-60); 24 | } 25 | -------------------------------------------------------------------------------- /examples/Basics/Image/CreateImage/data/mask.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Basics/Image/CreateImage/data/mask.jpg -------------------------------------------------------------------------------- /examples/Basics/Image/CreateImage/data/test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Basics/Image/CreateImage/data/test.jpg -------------------------------------------------------------------------------- /examples/Basics/Image/LoadDisplayImage/LoadDisplayImage.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Load and Display 3 | * 4 | * Images can be loaded and displayed to the screen at their actual size 5 | * or any other size. 6 | */ 7 | 8 | PImage a; // Declare variable "a" of type PImage 9 | 10 | void setup() { 11 | size(200, 200); 12 | // The file "jelly.jpg" must be in the data folder 13 | // of the current sketch to load successfully 14 | a = loadImage("jelly.jpg"); // Load the image into the program 15 | noLoop(); // Makes draw() only run once 16 | } 17 | 18 | void draw() { 19 | // Displays the image at its actual size at point (0,0) 20 | image(a, 0, 0); 21 | // Displays the image at point (100, 0) at half of its size 22 | image(a, 100, 0, a.width/2, a.height/2); 23 | } 24 | -------------------------------------------------------------------------------- /examples/Basics/Image/LoadDisplayImage/data/jelly.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Basics/Image/LoadDisplayImage/data/jelly.jpg -------------------------------------------------------------------------------- /examples/Basics/Image/Pointillism/Pointillism.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Pointillism 3 | * by Daniel Shiffman. 4 | * 5 | * Mouse horizontal location controls size of dots. 6 | * Creates a simple pointillist effect using ellipses colored 7 | * according to pixels in an image. 8 | * 9 | * Updated 27 February 2010. 10 | */ 11 | 12 | PImage img; 13 | 14 | int smallPoint = 2; 15 | int largePoint; 16 | int top, left; 17 | 18 | void setup() { 19 | size(200, 200); 20 | img = loadImage("eames.jpg"); 21 | //img = loadImage("sunflower.jpg"); // an alternative image 22 | noStroke(); 23 | background(255); 24 | smooth(); 25 | largePoint = min(width, height) / 10; 26 | // center the image on the screen 27 | left = (width - img.width) / 2; 28 | top = (height - img.height) / 2; 29 | } 30 | 31 | void draw() { 32 | float pointillize = map(mouseX, 0, width, smallPoint, largePoint); 33 | int x = int(random(img.width)); 34 | int y = int(random(img.height)); 35 | color pix = img.get(x, y); 36 | fill(pix, 128); 37 | ellipse(left + x, top + y, pointillize, pointillize); 38 | } 39 | -------------------------------------------------------------------------------- /examples/Basics/Image/Pointillism/data/eames.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Basics/Image/Pointillism/data/eames.jpg -------------------------------------------------------------------------------- /examples/Basics/Image/Pointillism/data/sunflower.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Basics/Image/Pointillism/data/sunflower.jpg -------------------------------------------------------------------------------- /examples/Basics/Image/Sprite/Sprite.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Sprite (Teddy) 3 | * by James Patterson. 4 | * 5 | * Demonstrates loading and displaying a transparent GIF image. 6 | */ 7 | 8 | PImage teddy; 9 | 10 | float xpos; 11 | float ypos; 12 | float drag = 30; 13 | 14 | void setup() { 15 | size(200, 200); 16 | teddy = loadImage("teddy.gif"); 17 | xpos = width/2; 18 | ypos = height/2; 19 | } 20 | 21 | void draw() { 22 | background(102); 23 | 24 | float difx = mouseX - xpos-teddy.width/2; 25 | if (abs(difx) > 1) { 26 | xpos = xpos + difx/drag; 27 | xpos = constrain(xpos, 0, width-teddy.width); 28 | } 29 | 30 | float dify = mouseY - ypos-teddy.height/2; 31 | if (abs(dify) > 1) { 32 | ypos = ypos + dify/drag; 33 | ypos = constrain(ypos, 0, height-teddy.height); 34 | } 35 | 36 | // Display the sprite at the position xpos, ypos 37 | image(teddy, xpos, ypos); 38 | } 39 | -------------------------------------------------------------------------------- /examples/Basics/Image/Sprite/data/teddy.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Basics/Image/Sprite/data/teddy.gif -------------------------------------------------------------------------------- /examples/Basics/Image/Sprite2/Sprite2.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Sprite2 (Teddy) 3 | * by James Patterson. 4 | * 5 | * Demonstrates loading and displaying a transparent GIF image. 6 | * This alternate version shows a sky image in the background. 7 | */ 8 | 9 | PImage teddy; 10 | PImage sky; 11 | 12 | float xpos; 13 | float ypos; 14 | float drag = 30.0; 15 | 16 | void setup() { 17 | size(200, 200); 18 | teddy = loadImage("teddy.gif"); 19 | sky = loadImage("sky.jpg"); 20 | xpos = width/2; 21 | ypos = height/2; 22 | // resize the background image so that it fills the screen 23 | if (sky.width != width || sky.height != height) { 24 | sky.resize(width, height); 25 | } 26 | } 27 | 28 | void draw() { 29 | background(sky); 30 | 31 | float difx = mouseX - xpos-teddy.width/2; 32 | if (abs(difx) > 1) { 33 | xpos = xpos + difx/drag; 34 | xpos = constrain(xpos, 0, width-teddy.width); 35 | } 36 | 37 | float dify = mouseY - ypos-teddy.height/2; 38 | if (abs(dify) > 1 ) { 39 | ypos = ypos + dify/drag; 40 | ypos = constrain(ypos, 0, height-teddy.height); 41 | } 42 | 43 | // Display the sprite at the position xpos, ypos 44 | image(teddy, xpos, ypos); 45 | } 46 | -------------------------------------------------------------------------------- /examples/Basics/Image/Sprite2/data/sky.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Basics/Image/Sprite2/data/sky.jpg -------------------------------------------------------------------------------- /examples/Basics/Image/Sprite2/data/teddy.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Basics/Image/Sprite2/data/teddy.gif -------------------------------------------------------------------------------- /examples/Basics/Image/Transparency/Transparency.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Transparency. 3 | * 4 | * Move the pointer left and right across the image to change 5 | * its position. This program overlays one image over another 6 | * by modifying the alpha value of the image with the tint() function. 7 | */ 8 | 9 | PImage a, b; 10 | float offset; 11 | 12 | void setup() { 13 | size(200, 200); 14 | a = loadImage("construct.jpg"); // Load an image into the program 15 | b = loadImage("wash.jpg"); // Load an image into the program 16 | } 17 | 18 | void draw() { 19 | image(a, 0, 0); 20 | float offsetTarget = map(mouseX, 0, width, -b.width/2 - width/2, 0); 21 | offset += (offsetTarget-offset)*0.05; 22 | tint(255, 153); 23 | image(b, offset, 20); 24 | } 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /examples/Basics/Image/Transparency/data/construct.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Basics/Image/Transparency/data/construct.jpg -------------------------------------------------------------------------------- /examples/Basics/Image/Transparency/data/wash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Basics/Image/Transparency/data/wash.jpg -------------------------------------------------------------------------------- /examples/Basics/Input/Constrain/Constrain.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Constrain. 3 | * 4 | * Move the mouse across the screen to move the circle. 5 | * The program constrains the circle to its box. 6 | * 7 | * Updated 27 February 2010 to handle changes in size(). 8 | */ 9 | 10 | float mx; 11 | float my; 12 | float easing = 0.05; 13 | int radius = 24; 14 | int edge = 56; 15 | int inner = edge + radius; 16 | 17 | void setup() { 18 | size(200, 200); 19 | noStroke(); 20 | smooth(); 21 | ellipseMode(RADIUS); 22 | rectMode(CORNERS); 23 | } 24 | 25 | void draw() { 26 | background(51); 27 | 28 | if (abs(mouseX - mx) > 0.1) { 29 | mx = mx + (mouseX - mx) * easing; 30 | } 31 | if (abs(mouseY - my) > 0.1) { 32 | my = my + (mouseY- my) * easing; 33 | } 34 | 35 | mx = constrain(mx, inner, width - inner); 36 | my = constrain(my, inner, height - inner); 37 | fill(76); 38 | rect(edge, edge, width-edge, height-edge); 39 | fill(255); 40 | ellipse(mx, my, radius, radius); 41 | } 42 | -------------------------------------------------------------------------------- /examples/Basics/Input/Easing/Easing.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Easing. 3 | * 4 | * Move the mouse across the screen and the symbol will follow. 5 | * Between drawing each frame of the animation, the program 6 | * calculates the difference between the position of the 7 | * symbol and the cursor. If the distance is larger than 8 | * 1 pixel, the symbol moves part of the distance (0.05) from its 9 | * current position toward the cursor. 10 | */ 11 | 12 | float x; 13 | float y; 14 | float targetX, targetY; 15 | float easing = 0.05; 16 | 17 | void setup() 18 | { 19 | size(200, 200); 20 | smooth(); 21 | noStroke(); 22 | } 23 | 24 | void draw() 25 | { 26 | background( 51 ); 27 | 28 | targetX = mouseX; 29 | float dx = targetX - x; 30 | if(abs(dx) > 1) { 31 | x += dx * easing; 32 | } 33 | 34 | targetY = mouseY; 35 | float dy = targetY - y; 36 | if(abs(dy) > 1) { 37 | y += dy * easing; 38 | } 39 | 40 | ellipse(x, y, 33, 33); 41 | } 42 | -------------------------------------------------------------------------------- /examples/Basics/Input/Keyboard/Keyboard.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Keyboard. 3 | * 4 | * Click on the image to give it focus and press the letter keys 5 | * to create forms in time and space. Each key has a unique identifying 6 | * number called its ASCII value. These numbers can be used to position 7 | * shapes in space. 8 | */ 9 | 10 | int rectWidth; 11 | 12 | void setup() { 13 | size(200, 200); 14 | noStroke(); 15 | background(0); 16 | rectWidth = width/4; 17 | } 18 | 19 | void draw() { 20 | // keep draw() here to continue looping while waiting for keys 21 | } 22 | 23 | void keyPressed() { 24 | int keyIndex = -1; 25 | if (key >= 'A' && key <= 'Z') { 26 | keyIndex = key - 'A'; 27 | } else if (key >= 'a' && key <= 'z') { 28 | keyIndex = key - 'a'; 29 | } 30 | if (keyIndex == -1) { 31 | // If it's not a letter key, clear the screen 32 | background(0); 33 | } else { 34 | // It's a letter key, fill a rectangle 35 | fill(millis() % 255); 36 | float x = map(keyIndex, 0, 25, 0, width - rectWidth); 37 | rect(x, 0, rectWidth, height); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /examples/Basics/Input/KeyboardFunctions/data/brugges.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Basics/Input/KeyboardFunctions/data/brugges.jpg -------------------------------------------------------------------------------- /examples/Basics/Input/Milliseconds/Milliseconds.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Milliseconds. 3 | * 4 | * A millisecond is 1/1000 of a second. 5 | * Processing keeps track of the number of milliseconds a program has run. 6 | * By modifying this number with the modulo(%) operator, 7 | * different patterns in time are created. 8 | */ 9 | 10 | float scale; 11 | 12 | void setup() 13 | { 14 | size(200, 200); 15 | noStroke(); 16 | scale = width/10; 17 | } 18 | 19 | void draw() 20 | { 21 | for(int i=0; i 90) { 39 | gx = 90; 40 | } 41 | 42 | if (gy > 90) { 43 | gy = 90; 44 | } else if (gy < 10) { 45 | gy = 10; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /examples/Basics/Input/Mouse2D/Mouse2D.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Mouse 2D. 3 | * 4 | * Moving the mouse changes the position and size of each box. 5 | */ 6 | 7 | void setup() 8 | { 9 | size(200, 200); 10 | noStroke(); 11 | rectMode(CENTER); 12 | } 13 | 14 | void draw() 15 | { 16 | background(51); 17 | fill(255, 204); 18 | rect(mouseX, height/2, mouseY/2+10, mouseY/2+10); 19 | fill(255, 204); 20 | int inverseX = width-mouseX; 21 | int inverseY = height-mouseY; 22 | rect(inverseX, height/2, (inverseY/2)+10, (inverseY/2)+10); 23 | } 24 | 25 | -------------------------------------------------------------------------------- /examples/Basics/Input/MousePress/MousePress.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Click. 3 | * 4 | * Move the mouse to position the shape. 5 | * Press the mouse button to invert the color. 6 | */ 7 | 8 | 9 | void setup() { 10 | size(200, 200); 11 | fill(126); 12 | background(102); 13 | } 14 | 15 | void draw() { 16 | if(mousePressed) { 17 | stroke(255); 18 | } else { 19 | stroke(0); 20 | } 21 | line(mouseX-66, mouseY, mouseX+66, mouseY); 22 | line(mouseX, mouseY-66, mouseX, mouseY+66); 23 | } 24 | -------------------------------------------------------------------------------- /examples/Basics/Input/StoringInput/StoringInput.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Storing Input. 3 | * 4 | * Move the mouse across the screen to change the position 5 | * of the circles. The positions of the mouse are recorded 6 | * into an array and played back every frame. Between each 7 | * frame, the newest value are added to the end of each array 8 | * and the oldest value is deleted. 9 | * 10 | * Updated 27 February 2010. 11 | */ 12 | 13 | int num = 60; 14 | float mx[] = new float[num]; 15 | float my[] = new float[num]; 16 | 17 | void setup() { 18 | size(200, 200); 19 | smooth(); 20 | noStroke(); 21 | fill(255, 153); 22 | } 23 | 24 | void draw() { 25 | background(51); 26 | 27 | // Cycle through the array, using a different entry on each frame. 28 | // Using modulo (%) like this is faster than moving all the values over. 29 | int which = frameCount % num; 30 | mx[which] = mouseX; 31 | my[which] = mouseY; 32 | 33 | for (int i = 0; i < num; i++) { 34 | // which+1 is the smallest (the oldest in the array) 35 | int index = (which+1 + i) % num; 36 | ellipse(mx[index], my[index], i/2, i/2); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /examples/Basics/Lights/Directional/Directional.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Directional. 3 | * 4 | * Move the mouse the change the direction of the light. 5 | * Directional light comes from one direction and is stronger 6 | * when hitting a surface squarely and weaker if it hits at a 7 | * a gentle angle. After hitting a surface, a directional lights 8 | * scatters in all directions. 9 | */ 10 | 11 | void setup() { 12 | size(640, 360, P3D); 13 | orientation(LANDSCAPE); 14 | noStroke(); 15 | fill(204); 16 | } 17 | 18 | void draw() { 19 | noStroke(); 20 | background(0); 21 | float dirY = (mouseY / float(height) - 0.5) * 2; 22 | float dirX = (mouseX / float(width) - 0.5) * 2; 23 | directionalLight(204, 204, 204, -dirX, -dirY, -1); 24 | translate(width/2 - 100, height/2, 0); 25 | sphere(80); 26 | translate(200, 0, 0); 27 | sphere(80); 28 | } 29 | 30 | -------------------------------------------------------------------------------- /examples/Basics/Lights/Mixture/Mixture.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Mixture 3 | * by Simon Greenwold. 4 | * 5 | * Display a box with three different kinds of lights. 6 | */ 7 | 8 | void setup() { 9 | size(640, 360, P3D); 10 | orientation(LANDSCAPE); 11 | noStroke(); 12 | } 13 | 14 | void draw() { 15 | background(0); 16 | translate(width / 2, height / 2); 17 | 18 | // Orange point light on the right 19 | pointLight(150, 100, 0, // Color 20 | 200, -150, 0); // Position 21 | 22 | // Blue directional light from the left 23 | directionalLight(0, 102, 255, // Color 24 | 1, 0, 0); // The x-, y-, z-axis direction 25 | 26 | // Yellow spotlight from the front 27 | spotLight(255, 255, 109, // Color 28 | 0, 40, 200, // Position 29 | 0, -0.5, -0.5, // Direction 30 | PI / 2, 2); // Angle, concentration 31 | 32 | rotateY(map(mouseX, 0, width, 0, PI)); 33 | rotateX(map(mouseY, 0, height, 0, PI)); 34 | box(150); 35 | } 36 | -------------------------------------------------------------------------------- /examples/Basics/Lights/OnOff/OnOff.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * On/Off. 3 | * 4 | * Uses the default lights to show a simple box. The lights() function 5 | * is used to turn on the default lighting. Click the mouse to turn the 6 | * lights off. 7 | */ 8 | 9 | float spin = 0.0; 10 | boolean on = true; 11 | 12 | void setup() { 13 | size(640, 360, P3D); 14 | orientation(LANDSCAPE); 15 | noStroke(); 16 | } 17 | 18 | void draw() { 19 | background(51); 20 | 21 | if (on) { 22 | lights(); 23 | } 24 | 25 | spin += 0.01; 26 | 27 | pushMatrix(); 28 | translate(width/2, height/2, 0); 29 | rotateX(PI/9); 30 | rotateY(PI/5 + spin); 31 | box(150); 32 | popMatrix(); 33 | } 34 | 35 | void mousePressed() { 36 | on = !on; 37 | } 38 | -------------------------------------------------------------------------------- /examples/Basics/Lights/Reflection/Reflection.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Reflection 3 | * by Simon Greenwold. 4 | * 5 | * Vary the specular reflection component of a material 6 | * with the horizontal position of the mouse. 7 | */ 8 | 9 | void setup() { 10 | size(640, 360, P3D); 11 | orientation(LANDSCAPE); 12 | noStroke(); 13 | colorMode(RGB, 1); 14 | fill(0.4); 15 | } 16 | 17 | void draw() { 18 | background(0); 19 | translate(width / 2, height / 2); 20 | // Set the specular color of lights that follow 21 | lightSpecular(1, 1, 1); 22 | directionalLight(0.8, 0.8, 0.8, 0, 0, -1); 23 | float s = mouseX / float(width); 24 | specular(s, s, s); 25 | sphere(120); 26 | } 27 | -------------------------------------------------------------------------------- /examples/Basics/Lights/Spot/Spot.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Spot. 3 | * 4 | * Move the mouse the change the position and concentation 5 | * of a blue spot light. 6 | */ 7 | 8 | int concentration = 600; // Try values 1 -> 10000 9 | 10 | void setup() 11 | { 12 | size(640, 360, P3D); 13 | orientation(LANDSCAPE); 14 | noStroke(); 15 | fill(204); 16 | sphereDetail(30); 17 | } 18 | 19 | void draw() 20 | { 21 | background(0); 22 | 23 | // Light the bottom of the sphere 24 | directionalLight(51, 102, 126, 0, -1, 0); 25 | 26 | // Orange light on the upper-right of the sphere 27 | spotLight(204, 153, 0, 360, 160, 600, 0, 0, -1, PI/2, 600); 28 | 29 | // Moving spotlight that follows the mouse 30 | spotLight(102, 153, 204, 360, mouseY, 600, 0, 0, -1, PI/2, 600); 31 | 32 | translate(width/2, height/2, 0); 33 | sphere(120); 34 | } 35 | 36 | -------------------------------------------------------------------------------- /examples/Basics/Math/Distance2D/Distance2D.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Distance 2D. 3 | * 4 | * Move the mouse across the image to obscure and reveal the matrix. 5 | * Measures the distance from the mouse to each square and sets the 6 | * size proportionally. 7 | */ 8 | 9 | float max_distance; 10 | 11 | void setup() { 12 | size(200, 200); 13 | smooth(); 14 | noStroke(); 15 | max_distance = dist(0, 0, width, height); 16 | } 17 | 18 | void draw() 19 | { 20 | background(51); 21 | 22 | for(int i = 0; i <= width; i += 20) { 23 | for(int j = 0; j <= height; j += 20) { 24 | float size = dist(mouseX, mouseY, i, j); 25 | size = size/max_distance * 66; 26 | ellipse(i, j, size, size); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /examples/Basics/Math/DoubleRandom/DoubleRandom.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Double Random 3 | * by Ira Greenberg. 4 | * 5 | * Using two random() calls and the point() function 6 | * to create an irregular sawtooth line. 7 | */ 8 | 9 | size(200, 200); 10 | background(0); 11 | int totalPts = 300; 12 | float steps = totalPts + 1; 13 | stroke(255); 14 | float rand = 0; 15 | 16 | for (int i = 1; i < steps; i++){ 17 | point( (width/steps) * i, (height/2) + random(-rand, rand) ); 18 | rand += random(-5, 5); 19 | } 20 | 21 | -------------------------------------------------------------------------------- /examples/Basics/Math/IncrementDecrement/IncrementDecrement.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Increment Decrement. 3 | * 4 | * Writing "a++" is equivalent to "a = a + 1". 5 | * Writing "a--" is equivalent to "a = a - 1". 6 | */ 7 | 8 | int a; 9 | int b; 10 | boolean direction; 11 | 12 | void setup() 13 | { 14 | size(200, 200); 15 | colorMode(RGB, width); 16 | a = 0; 17 | b = width; 18 | direction = true; 19 | frameRate(30); 20 | } 21 | 22 | void draw() 23 | { 24 | a++; 25 | if(a > width) { 26 | a = 0; 27 | direction = !direction; 28 | } 29 | if(direction == true){ 30 | stroke(a); 31 | } else { 32 | stroke(width-a); 33 | } 34 | line(a, 0, a, height/2); 35 | 36 | b--; 37 | if(b < 0) { 38 | b = width; 39 | } 40 | if(direction == true) { 41 | stroke(width-b); 42 | } else { 43 | stroke(b); 44 | } 45 | line(b, height/2+1, b, height); 46 | } 47 | -------------------------------------------------------------------------------- /examples/Basics/Math/Modulo/Modulo.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Modulo. 3 | * 4 | * The modulo operator (%) returns the remainder of a number 5 | * divided by another. As in this example, it is often used 6 | * to keep numerical values within a set range. 7 | */ 8 | 9 | int num = 20; 10 | float c; 11 | 12 | void setup() 13 | { 14 | size(200,200); 15 | fill(255); 16 | frameRate(30); 17 | } 18 | 19 | void draw() 20 | { 21 | background(0); 22 | c+=0.1; 23 | for(int i=1; i TWO_PI) { angle = 0; } 45 | } 46 | 47 | -------------------------------------------------------------------------------- /examples/Basics/Objects/CompositeObjects/CompositeObjects.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Composite Objects 3 | * 4 | * An object can include several other objects. Creating such composite objects 5 | * is a good way to use the principles of modularity and build higher levels of 6 | * abstraction within a program. 7 | */ 8 | 9 | EggRing er1, er2; 10 | 11 | 12 | void setup() { 13 | size(200, 200); 14 | smooth(); 15 | er1 = new EggRing(66, 132, 0.1, 66); 16 | er2 = new EggRing(132, 180, 0.05, 132); 17 | } 18 | 19 | 20 | void draw() { 21 | background(0); 22 | er1.transmit(); 23 | er2.transmit(); 24 | } 25 | -------------------------------------------------------------------------------- /examples/Basics/Objects/CompositeObjects/Egg.pde: -------------------------------------------------------------------------------- 1 | class Egg { 2 | float x, y; // X-coordinate, y-coordinate 3 | float tilt; // Left and right angle offset 4 | float angle; // Used to define the tilt 5 | float scalar; // Height of the egg 6 | 7 | // Constructor 8 | Egg(int xpos, int ypos, float t, float s) { 9 | x = xpos; 10 | y = ypos; 11 | tilt = t; 12 | scalar = s / 100.0; 13 | } 14 | 15 | void wobble() { 16 | tilt = cos(angle) / 8; 17 | angle += 0.1; 18 | } 19 | 20 | void display() { 21 | noStroke(); 22 | fill(255); 23 | pushMatrix(); 24 | translate(x, y); 25 | rotate(tilt); 26 | scale(scalar); 27 | beginShape(); 28 | vertex(0, -100); 29 | bezierVertex(25, -100, 40, -65, 40, -40); 30 | bezierVertex(40, -15, 25, 0, 0, 0); 31 | bezierVertex(-25, 0, -40, -15, -40, -40); 32 | bezierVertex(-40, -65, -25, -100, 0, -100); 33 | endShape(); 34 | popMatrix(); 35 | } 36 | } -------------------------------------------------------------------------------- /examples/Basics/Objects/CompositeObjects/EggRing.pde: -------------------------------------------------------------------------------- 1 | class EggRing { 2 | Egg ovoid; 3 | Ring circle = new Ring(); 4 | 5 | EggRing(int x, int y, float t, float sp) { 6 | ovoid = new Egg(x, y, t, sp); 7 | circle.start(x, y - sp/2); 8 | } 9 | 10 | void transmit() { 11 | ovoid.wobble(); 12 | ovoid.display(); 13 | circle.grow(); 14 | circle.display(); 15 | if (circle.on == false) { 16 | circle.on = true; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /examples/Basics/Objects/CompositeObjects/Ring.pde: -------------------------------------------------------------------------------- 1 | class Ring { 2 | float x, y; // X-coordinate, y-coordinate 3 | float diameter; // Diameter of the ring 4 | boolean on = false; // Turns the display on and off 5 | void start(float xpos, float ypos) { 6 | x = xpos; 7 | y = ypos; 8 | on = true; 9 | diameter = 1; 10 | } 11 | void grow() { 12 | if (on == true) { 13 | diameter += 0.5; 14 | if (diameter > width*2) { 15 | diameter = 0.0; 16 | } 17 | } 18 | } 19 | void display() { 20 | if (on == true) { 21 | noFill(); 22 | strokeWeight(4); 23 | stroke(155, 153); 24 | ellipse(x, y, diameter, diameter); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /examples/Basics/Shape/DisableStyle/DisableStyle.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Ignore Styles. 3 | * Illustration by George Brower. 4 | * 5 | * Shapes are loaded with style information that tells them how 6 | * to draw (the color, stroke weight, etc.) The disableStyle() 7 | * method of PShape turns off this information. The enableStyle() 8 | * method turns it back on. 9 | */ 10 | 11 | PShape bot; 12 | 13 | void setup() { 14 | size(640, 360); 15 | smooth(); 16 | // The file "bot1.svg" must be in the data folder 17 | // of the current sketch to load successfully 18 | bot = loadShape("bot1.svg"); 19 | noLoop(); 20 | } 21 | 22 | void draw() { 23 | background(102); 24 | 25 | // Draw left bot 26 | bot.disableStyle(); // Ignore the colors in the SVG 27 | fill(0, 102, 153); // Set the SVG fill to blue 28 | stroke(255); // Set the SVG fill to white 29 | shape(bot, 20, 25, 300, 300); 30 | 31 | // Draw right bot 32 | bot.enableStyle(); 33 | shape(bot, 320, 25, 300, 300); 34 | } 35 | -------------------------------------------------------------------------------- /examples/Basics/Shape/LoadDisplayOBJ/LoadDisplayOBJ.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Load and Display an OBJ Shape. 3 | * 4 | * The loadShape() command is used to read simple SVG (Scalable Vector Graphics) 5 | * files and OBJ (Object) files into a Processing sketch. This example loads an 6 | * OBJ file of a rocket and displays it to the screen. 7 | */ 8 | 9 | 10 | PShape rocket; 11 | 12 | float ry; 13 | 14 | public void setup() { 15 | size(640, 360, P3D); 16 | orientation(LANDSCAPE); 17 | 18 | rocket = loadShape("rocket.obj"); 19 | } 20 | 21 | public void draw() { 22 | background(0); 23 | lights(); 24 | 25 | translate(width/2, height/2 + 100, -200); 26 | rotateZ(PI); 27 | rotateY(ry); 28 | shape(rocket); 29 | 30 | ry += 0.02; 31 | } 32 | -------------------------------------------------------------------------------- /examples/Basics/Shape/LoadDisplayOBJ/data/rocket.mtl: -------------------------------------------------------------------------------- 1 | newmtl Default 2 | illum 2 3 | Ka 0.698039 0.698039 0.698039 4 | Kd 0.698039 0.698039 0.698039 5 | Ks 0.710000 0.710000 0.710000 6 | Ns 76.109253 7 | map_Kd rocket.png 8 | 9 | -------------------------------------------------------------------------------- /examples/Basics/Shape/LoadDisplayOBJ/data/rocket.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Basics/Shape/LoadDisplayOBJ/data/rocket.png -------------------------------------------------------------------------------- /examples/Basics/Shape/LoadDisplaySVG/LoadDisplaySVG.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Load and Display a Shape. 3 | * Illustration by George Brower. 4 | * 5 | * The loadShape() command is used to read simple SVG (Scalable Vector Graphics) 6 | * files and OBJ (Object) files into a Processing sketch. This example loads an 7 | * SVG file of a monster robot face and displays it to the screen. 8 | */ 9 | 10 | // The next line is needed if running in JavaScript Mode with Processing.js 11 | /* @pjs preload="bot1.svg"; */ 12 | 13 | PShape bot; 14 | 15 | void setup() { 16 | size(640, 360); 17 | // The file "bot1.svg" must be in the data folder 18 | // of the current sketch to load successfully 19 | bot = loadShape("bot1.svg"); 20 | } 21 | 22 | void draw(){ 23 | background(102); 24 | shape(bot, 110, 90, 100, 100); // Draw at coordinate (110, 90) at size 100 x 100 25 | shape(bot, 280, 40); // Draw at coordinate (280, 40) at the default size 26 | } 27 | -------------------------------------------------------------------------------- /examples/Basics/Shape/ScaleShape/ScaleShape.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Scale Shape. 3 | * Illustration by George Brower. 4 | * 5 | * Move the mouse left and right to zoom the SVG file. 6 | * This shows how, unlike an imported image, the lines 7 | * remain smooth at any size. 8 | */ 9 | 10 | PShape bot; 11 | 12 | void setup() { 13 | size(640, 360); 14 | smooth(); 15 | // The file "bot1.svg" must be in the data folder 16 | // of the current sketch to load successfully 17 | bot = loadShape("bot1.svg"); 18 | } 19 | 20 | void draw() { 21 | background(102); 22 | translate(width/2, height/2); 23 | float zoom = map(mouseX, 0, width, 0.1, 4.5); 24 | scale(zoom); 25 | shape(bot, -140, -140); 26 | } 27 | -------------------------------------------------------------------------------- /examples/Basics/Structure/CreateGraphics/CreateGraphics.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Create Graphics. 3 | * 4 | * The createGraphics() function creates an object from the PGraphics class 5 | * (PGraphics is the main graphics and rendering context for Processing). 6 | * The beginDraw() method is necessary to prepare for drawing and endDraw() is 7 | * necessary to finish. Use this class if you need to draw into an off-screen 8 | * graphics buffer or to maintain two contexts with different properties. 9 | */ 10 | 11 | PGraphics pg; 12 | 13 | void setup() { 14 | size(200, 200); 15 | pg = createGraphics(80, 80); 16 | } 17 | 18 | void draw() { 19 | fill(0, 12); 20 | rect(0, 0, width, height); 21 | fill(255); 22 | noStroke(); 23 | ellipse(mouseX, mouseY, 60, 60); 24 | 25 | pg.beginDraw(); 26 | pg.background(102); 27 | pg.noFill(); 28 | pg.stroke(255); 29 | pg.ellipse(mouseX-60, mouseY-60, 60, 60); 30 | pg.endDraw(); 31 | 32 | image(pg, 60, 60); 33 | } 34 | -------------------------------------------------------------------------------- /examples/Basics/Structure/CreateGraphics/data/mask.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Basics/Structure/CreateGraphics/data/mask.jpg -------------------------------------------------------------------------------- /examples/Basics/Structure/CreateGraphics/data/test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Basics/Structure/CreateGraphics/data/test.jpg -------------------------------------------------------------------------------- /examples/Basics/Structure/Functions/Functions.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Functions. 3 | * 4 | * The drawTarget() function makes it easy to draw many distinct targets. 5 | * Each call to drawTarget() specifies the position, size, and number of 6 | * rings for each target. 7 | */ 8 | 9 | void setup() 10 | { 11 | size(200, 200); 12 | background(51); 13 | noStroke(); 14 | smooth(); 15 | noLoop(); 16 | } 17 | 18 | void draw() 19 | { 20 | drawTarget(68, 34, 200, 10); 21 | drawTarget(152, 16, 100, 3); 22 | drawTarget(100, 144, 80, 5); 23 | } 24 | 25 | void drawTarget(int xloc, int yloc, int size, int num) 26 | { 27 | float grayvalues = 255/num; 28 | float steps = size/num; 29 | for(int i=0; i 1) { 28 | level = level - 1; 29 | drawCircle(x - radius/2, radius/2, level); 30 | drawCircle(x + radius/2, radius/2, level); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /examples/Basics/Structure/Recursion2/Recursion2.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Recursion. 3 | * 4 | * A demonstration of recursion, which means functions call themselves. 5 | * Notice how the drawCircle() function calls itself at the end of its block. 6 | * It continues to do this until the variable "level" is equal to 1. 7 | */ 8 | 9 | void setup() 10 | { 11 | size(200, 200); 12 | noStroke(); 13 | smooth(); 14 | drawCircle(100, 100, 80, 8); 15 | } 16 | 17 | void drawCircle(float x, float y, int radius, int level) 18 | { 19 | float tt = 126 * level/6.0; 20 | fill(tt, 153); 21 | ellipse(x, y, radius*2, radius*2); 22 | if(level > 1) { 23 | level = level - 1; 24 | int num = int(random(2, 6)); 25 | for(int i=0; i TWO_PI) { 26 | a = 0.0; 27 | } 28 | 29 | translate(width/2, height/2); 30 | 31 | rotateX(a); 32 | rotateY(a * 2.0); 33 | fill(255); 34 | rect(-rSize, -rSize, rSize*2, rSize*2); 35 | 36 | rotateX(a * 1.001); 37 | rotateY(a * 2.002); 38 | fill(0); 39 | rect(-rSize, -rSize, rSize*2, rSize*2); 40 | 41 | } 42 | -------------------------------------------------------------------------------- /examples/Basics/Transform/Scale/Scale.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Scale 3 | * by Denis Grutze. 4 | * 5 | * Paramenters for the scale() function are values specified 6 | * as decimal percentages. For example, the method call scale(2.0) 7 | * will increase the dimension of the shape by 200 percent. 8 | * Objects always scale from the origin. 9 | */ 10 | 11 | float a = 0.0; 12 | float s = 0.0; 13 | 14 | void setup() 15 | { 16 | size(200,200); 17 | noStroke(); 18 | rectMode(CENTER); 19 | frameRate(30); 20 | } 21 | 22 | void draw() 23 | { 24 | background(102); 25 | 26 | a = a + 0.04; 27 | s = cos(a)*2; 28 | 29 | translate(width/2, height/2); 30 | scale(s); 31 | fill(51); 32 | rect(0, 0, 50, 50); 33 | 34 | translate(75, 0); 35 | fill(255); 36 | scale(s); 37 | rect(0, 0, 50, 50); 38 | } 39 | -------------------------------------------------------------------------------- /examples/Basics/Transform/Translate/Translate.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Translate. 3 | * 4 | * The translate() function allows objects to be moved 5 | * to any location within the window. The first parameter 6 | * sets the x-axis offset and the second parameter sets the 7 | * y-axis offset. 8 | */ 9 | 10 | float x, y; 11 | float size = 40.0; 12 | 13 | void setup() 14 | { 15 | size(200,200); 16 | noStroke(); 17 | frameRate(30); 18 | } 19 | 20 | void draw() 21 | { 22 | background(102); 23 | 24 | x = x + 0.8; 25 | 26 | if (x > width + size) { 27 | x = -size; 28 | } 29 | 30 | translate(x, height/2-size/2); 31 | fill(255); 32 | rect(-size/2, -size/2, size, size); 33 | 34 | // Transforms accumulate. 35 | // Notice how this rect moves twice 36 | // as fast as the other, but it has 37 | // the same parameter for the x-axis value 38 | translate(x, size); 39 | fill(0); 40 | rect(-size/2, -size/2, size, size); 41 | } 42 | -------------------------------------------------------------------------------- /examples/Basics/Typography/Letters/data/CourierNew36.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Basics/Typography/Letters/data/CourierNew36.vlw -------------------------------------------------------------------------------- /examples/Basics/Typography/Words/Words.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Words. 3 | * 4 | * The text() function is used for writing words to the screen. 5 | */ 6 | 7 | 8 | int x = 30; 9 | PFont fontA; 10 | 11 | void setup() 12 | { 13 | size(200, 200); 14 | background(102); 15 | 16 | // Load the font. Fonts must be placed within the data 17 | // directory of your sketch. Use Tools > Create Font 18 | // to create a distributable bitmap font. 19 | // For vector fonts, use the createFont() function. 20 | fontA = loadFont("Ziggurat-HTF-Black-32.vlw"); 21 | 22 | // Set the font and its size (in units of pixels) 23 | textFont(fontA, 32); 24 | 25 | // Only draw once 26 | noLoop(); 27 | } 28 | 29 | void draw() { 30 | // Use fill() to change the value or color of the text 31 | fill(0); 32 | text("ichi", x, 60); 33 | fill(51); 34 | text("ni", x, 95); 35 | fill(204); 36 | text("san", x, 130); 37 | fill(255); 38 | text("shi", x, 165); 39 | } 40 | -------------------------------------------------------------------------------- /examples/Basics/Typography/Words/data/Ziggurat-HTF-Black-32.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Basics/Typography/Words/data/Ziggurat-HTF-Black-32.vlw -------------------------------------------------------------------------------- /examples/Basics/Web/LoadingImages/LoadingImages.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Loading Images. 3 | * 4 | * Loads an image from over the network. Be sure to have INTERNET 5 | * permission enabled, otherwise img will always return null. 6 | */ 7 | 8 | size(200, 200); 9 | PImage img1; 10 | img1 = loadImage("http://processing.org/img/processing_cover.gif"); 11 | if (img != null) { 12 | image(img1, 0, 0); 13 | } 14 | -------------------------------------------------------------------------------- /examples/Demos/Graphics/Particles/ParticleSystem.pde: -------------------------------------------------------------------------------- 1 | class ParticleSystem { 2 | ArrayList particles; 3 | 4 | PShape particleShape; 5 | 6 | ParticleSystem(int n) { 7 | particles = new ArrayList(); 8 | particleShape = createShape(PShape.GROUP); 9 | 10 | for (int i = 0; i < n; i++) { 11 | Particle p = new Particle(); 12 | particles.add(p); 13 | particleShape.addChild(p.getShape()); 14 | } 15 | } 16 | 17 | void update() { 18 | for (Particle p : particles) { 19 | p.update(); 20 | } 21 | } 22 | 23 | void setEmitter(float x, float y) { 24 | for (Particle p : particles) { 25 | if (p.isDead()) { 26 | p.rebirth(x, y); 27 | } 28 | } 29 | } 30 | 31 | void display() { 32 | 33 | shape(particleShape); 34 | } 35 | } 36 | 37 | -------------------------------------------------------------------------------- /examples/Demos/Graphics/Particles/Particles.pde: -------------------------------------------------------------------------------- 1 | // Particles, by Daniel Shiffman 2 | 3 | ParticleSystem ps; 4 | PImage sprite; 5 | 6 | void setup() { 7 | size(displayWidth, displayHeight, P2D); 8 | orientation(LANDSCAPE); 9 | sprite = loadImage("sprite.png"); 10 | ps = new ParticleSystem(2000); 11 | 12 | // Writing to the depth buffer is disabled to avoid rendering 13 | // artifacts due to the fact that the particles are semi-transparent 14 | // but not z-sorted. 15 | hint(DISABLE_DEPTH_MASK); 16 | } 17 | 18 | void draw () { 19 | background(0); 20 | ps.update(); 21 | ps.display(); 22 | 23 | ps.setEmitter(mouseX,mouseY); 24 | 25 | fill(255); 26 | textSize(16); 27 | text("Frame rate: " + int(frameRate),10,20); 28 | } 29 | 30 | 31 | -------------------------------------------------------------------------------- /examples/Demos/Graphics/Particles/data/sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Demos/Graphics/Particles/data/sprite.png -------------------------------------------------------------------------------- /examples/Demos/Graphics/Planets/data/mercury.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Demos/Graphics/Planets/data/mercury.jpg -------------------------------------------------------------------------------- /examples/Demos/Graphics/Planets/data/planet.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Demos/Graphics/Planets/data/planet.jpg -------------------------------------------------------------------------------- /examples/Demos/Graphics/Planets/data/starfield.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Demos/Graphics/Planets/data/starfield.jpg -------------------------------------------------------------------------------- /examples/Demos/Graphics/Planets/data/sun.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Demos/Graphics/Planets/data/sun.jpg -------------------------------------------------------------------------------- /examples/Demos/Graphics/Trefoil/Trefoil.pde: -------------------------------------------------------------------------------- 1 | // Trefoil, by Andres Colubri 2 | // A parametric surface is textured procedurally 3 | // by drawing on an offscreen PGraphics surface. 4 | 5 | PGraphics pg; 6 | PShape trefoil; 7 | 8 | void setup() { 9 | size(displayWidth, displayHeight, P3D); 10 | orientation(PORTRAIT); 11 | 12 | textureMode(NORMAL); 13 | noStroke(); 14 | 15 | // Creating offscreen surface for 3D rendering. 16 | pg = createGraphics(32, 512, P3D); 17 | pg.beginDraw(); 18 | pg.background(0, 0); 19 | pg.noStroke(); 20 | pg.fill(255, 0, 0, 200); 21 | pg.endDraw(); 22 | 23 | // Saving trefoil surface into a PShape3D object 24 | trefoil = createTrefoil(250, 60, 15, pg); 25 | } 26 | 27 | void draw() { 28 | background(0); 29 | 30 | pg.beginDraw(); 31 | pg.ellipse(random(pg.width), random(pg.height), 4, 4); 32 | pg.endDraw(); 33 | 34 | ambient(250, 250, 250); 35 | pointLight(255, 255, 255, 0, 0, 200); 36 | 37 | pushMatrix(); 38 | translate(width/2, height/2, -200); 39 | rotateX(frameCount * PI / 500); 40 | rotateY(frameCount * PI / 500); 41 | shape(trefoil); 42 | popMatrix(); 43 | } 44 | -------------------------------------------------------------------------------- /examples/Demos/Graphics/Trefoil/data/particle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Demos/Graphics/Trefoil/data/particle.png -------------------------------------------------------------------------------- /examples/Demos/Graphics/Yellowtail/Polygon.pde: -------------------------------------------------------------------------------- 1 | public class Polygon { 2 | int npoints; 3 | int[] xpoints; 4 | int[] ypoints; 5 | 6 | public Polygon(int n) { 7 | npoints = n; 8 | xpoints = new int[n]; 9 | ypoints = new int[n]; 10 | } 11 | } 12 | 13 | -------------------------------------------------------------------------------- /examples/Demos/Graphics/Yellowtail/Vec3f.pde: -------------------------------------------------------------------------------- 1 | class Vec3f { 2 | float x; 3 | float y; 4 | float p; // Pressure 5 | 6 | Vec3f() { 7 | set(0, 0, 0); 8 | } 9 | 10 | Vec3f(float ix, float iy, float ip) { 11 | set(ix, iy, ip); 12 | } 13 | 14 | void set(float ix, float iy, float ip) { 15 | x = ix; 16 | y = iy; 17 | p = ip; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /examples/Demos/Performance/DynamicParticlesImmediate/data/sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Demos/Performance/DynamicParticlesImmediate/data/sprite.png -------------------------------------------------------------------------------- /examples/Demos/Performance/DynamicParticlesRetained/data/sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Demos/Performance/DynamicParticlesRetained/data/sprite.png -------------------------------------------------------------------------------- /examples/Demos/Performance/LineRendering/LineRendering.pde: -------------------------------------------------------------------------------- 1 | import processing.opengl.*; 2 | 3 | public void setup() { 4 | size(800, 600, OPENGL); 5 | orientation(LANDSCAPE); 6 | } 7 | 8 | public void draw() { 9 | background(255); 10 | stroke(0, 10); 11 | for (int i = 0; i < 5000; i++) { 12 | float x0 = random(width); 13 | float y0 = random(height); 14 | float z0 = random(-100, 100); 15 | float x1 = random(width); 16 | float y1 = random(height); 17 | float z1 = random(-100, 100); 18 | 19 | // purely 2D lines will trigger the GLU 20 | // tessellator to add accurate line caps, 21 | // but performance will be substantially 22 | // lower. 23 | line(x0, y0, z0, x1, y1, z1); 24 | } 25 | if (frameCount % 10 == 0) println(frameRate); 26 | } 27 | -------------------------------------------------------------------------------- /examples/Demos/Performance/QuadRendering/QuadRendering.pde: -------------------------------------------------------------------------------- 1 | import processing.opengl.*; 2 | 3 | public void setup() { 4 | size(800, 600, OPENGL); 5 | orientation(LANDSCAPE); 6 | 7 | noStroke(); 8 | fill(0, 1); 9 | } 10 | 11 | public void draw() { 12 | background(255); 13 | for (int i = 0; i < 5000; i++) { 14 | float x = random(width); 15 | float y = random(height); 16 | rect(x, y, 30, 30); 17 | } 18 | if (frameCount % 10 == 0) println(frameRate); 19 | } 20 | -------------------------------------------------------------------------------- /examples/Demos/Performance/StaticParticlesImmediate/data/sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Demos/Performance/StaticParticlesImmediate/data/sprite.png -------------------------------------------------------------------------------- /examples/Demos/Performance/StaticParticlesRetained/data/sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Demos/Performance/StaticParticlesRetained/data/sprite.png -------------------------------------------------------------------------------- /examples/Demos/Performance/TextRendering/TextRendering.pde: -------------------------------------------------------------------------------- 1 | import processing.opengl.*; 2 | 3 | public void setup() { 4 | size(800, 600, OPENGL); 5 | orientation(LANDSCAPE); 6 | fill(0); 7 | } 8 | 9 | public void draw() { 10 | background(255); 11 | for (int i = 0; i < 1000; i++) { 12 | float x = random(width); 13 | float y = random(height); 14 | text("HELLO", x, y); 15 | } 16 | if (frameCount % 10 == 0) println(frameRate); 17 | } 18 | -------------------------------------------------------------------------------- /examples/Demos/Tests/NoBackgroundTest/NoBackgroundTest.pde: -------------------------------------------------------------------------------- 1 | void setup() { 2 | size(400, 400, P2D); 3 | background(255, 0, 0); 4 | fill(255, 150); 5 | } 6 | 7 | void draw() { 8 | ellipse(mouseX, mouseY, 100, 100); 9 | } 10 | 11 | -------------------------------------------------------------------------------- /examples/Demos/Tests/OffscreenTest/OffscreenTest.pde: -------------------------------------------------------------------------------- 1 | PGraphics pg; 2 | 3 | void setup() { 4 | size(400, 400, P3D); 5 | 6 | pg = createGraphics(400, 400, P3D); 7 | } 8 | 9 | void draw() { 10 | background(0); 11 | 12 | pg.beginDraw(); 13 | pg.background(255, 0, 0); 14 | pg.ellipse(mouseX, mouseY, 100, 100); 15 | pg.endDraw(); 16 | 17 | image(pg, 0, 0, 400, 400); 18 | } 19 | 20 | -------------------------------------------------------------------------------- /examples/Demos/Tests/RedrawTest/RedrawTest.pde: -------------------------------------------------------------------------------- 1 | void setup() { 2 | size(400, 400, P2D); 3 | noLoop(); 4 | } 5 | 6 | void draw() { 7 | background(255, 0, 0); 8 | ellipse(mouseX, mouseY, 100, 50); 9 | println("draw"); 10 | } 11 | 12 | void mousePressed() { 13 | redraw(); 14 | } 15 | 16 | -------------------------------------------------------------------------------- /examples/Sensors/Accelerometer/Accelerometer.pde: -------------------------------------------------------------------------------- 1 | AccelerometerManager accel; 2 | float ax, ay, az; 3 | 4 | 5 | void setup() { 6 | accel = new AccelerometerManager(this); 7 | orientation(PORTRAIT); 8 | noLoop(); 9 | } 10 | 11 | 12 | void draw() { 13 | background(0); 14 | fill(255); 15 | textSize(70); 16 | textAlign(CENTER, CENTER); 17 | text("x: " + nf(ax, 1, 2) + "\n" + 18 | "y: " + nf(ay, 1, 2) + "\n" + 19 | "z: " + nf(az, 1, 2), 20 | 0, 0, width, height); 21 | } 22 | 23 | 24 | public void resume() { 25 | if (accel != null) { 26 | accel.resume(); 27 | } 28 | } 29 | 30 | 31 | public void pause() { 32 | if (accel != null) { 33 | accel.pause(); 34 | } 35 | } 36 | 37 | 38 | public void shakeEvent(float force) { 39 | println("shake : " + force); 40 | } 41 | 42 | 43 | public void accelerationEvent(float x, float y, float z) { 44 | // println("acceleration: " + x + ", " + y + ", " + z); 45 | ax = x; 46 | ay = y; 47 | az = z; 48 | redraw(); 49 | } -------------------------------------------------------------------------------- /examples/Sensors/Compass/Compass.pde: -------------------------------------------------------------------------------- 1 | CompassManager compass; 2 | float direction; 3 | 4 | 5 | void setup() { 6 | compass = new CompassManager(this); 7 | } 8 | 9 | 10 | void pause() { 11 | if (compass != null) compass.pause(); 12 | } 13 | 14 | 15 | void resume() { 16 | if (compass != null) compass.resume(); 17 | } 18 | 19 | 20 | void draw() { 21 | background(255); 22 | fill(192, 0, 0); 23 | noStroke(); 24 | 25 | translate(width/2, height/2); 26 | scale(2); 27 | rotate(direction); 28 | beginShape(); 29 | vertex(0, -50); 30 | vertex(-20, 60); 31 | vertex(0, 50); 32 | vertex(20, 60); 33 | endShape(CLOSE); 34 | } 35 | 36 | 37 | void directionEvent(float newDirection) { 38 | direction = newDirection; 39 | } 40 | -------------------------------------------------------------------------------- /examples/Topics/Advanced Data/ArrayListClass/Ball.pde: -------------------------------------------------------------------------------- 1 | // Simple bouncing ball class 2 | 3 | class Ball { 4 | 5 | float x; 6 | float y; 7 | float speed; 8 | float gravity; 9 | float w; 10 | float life = 255; 11 | 12 | Ball(float tempX, float tempY, float tempW) { 13 | x = tempX; 14 | y = tempY; 15 | w = tempW; 16 | speed = 0; 17 | gravity = 0.1; 18 | } 19 | 20 | void move() { 21 | // Add gravity to speed 22 | speed = speed + gravity; 23 | // Add speed to y location 24 | y = y + speed; 25 | // If square reaches the bottom 26 | // Reverse speed 27 | if (y > height) { 28 | // Dampening 29 | speed = speed * -0.8; 30 | y = height; 31 | } 32 | } 33 | 34 | boolean finished() { 35 | // Balls fade out 36 | life--; 37 | if (life < 0) { 38 | return true; 39 | } else { 40 | return false; 41 | } 42 | } 43 | 44 | void display() { 45 | // Display the circle 46 | fill(0,life); 47 | //stroke(0,life); 48 | ellipse(x,y,w,w); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /examples/Topics/Advanced Data/HashMapClass/Word.pde: -------------------------------------------------------------------------------- 1 | class Word { 2 | 3 | int count; 4 | String word; 5 | 6 | Word(String s) { 7 | word = s; 8 | count = 1; 9 | } 10 | 11 | void count() { 12 | count++; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/AnimatedSprite.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Animated Sprite (Shifty + Teddy) 3 | * by James Patterson. 4 | * 5 | * Press the mouse button to change animations. 6 | * Demonstrates loading, displaying, and animating GIF images. 7 | * It would be easy to write a program to display 8 | * animated GIFs, but would not allow as much control over 9 | * the display sequence and rate of display. 10 | */ 11 | 12 | Animation animation1, animation2; 13 | float xpos, ypos; 14 | float drag = 30.0; 15 | 16 | void setup() { 17 | size(200, 200); 18 | background(255, 204, 0); 19 | frameRate(24); 20 | animation1 = new Animation("PT_Shifty_", 38); 21 | animation2 = new Animation("PT_Teddy_", 60); 22 | } 23 | 24 | void draw() { 25 | float difx = mouseX - xpos; 26 | if (abs(difx) > 1.0) { 27 | xpos = xpos + difx/drag; 28 | xpos = constrain(xpos, 0, width); 29 | } 30 | 31 | // Display the sprite at the position xpos, ypos 32 | if (mousePressed) { 33 | background(153, 153, 0); 34 | animation1.display(xpos-animation1.getWidth()/2, ypos); 35 | } else { 36 | background(255, 204, 0); 37 | animation2.display(xpos-animation1.getWidth()/2, ypos); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/Animation.pde: -------------------------------------------------------------------------------- 1 | // Class for animating a sequence of GIFs 2 | 3 | class Animation { 4 | PImage[] images; 5 | int imageCount; 6 | int frame; 7 | 8 | Animation(String imagePrefix, int count) { 9 | imageCount = count; 10 | images = new PImage[imageCount]; 11 | 12 | for (int i = 0; i < imageCount; i++) { 13 | // Use nf() to number format 'i' into four digits 14 | String filename = imagePrefix + nf(i, 4) + ".gif"; 15 | images[i] = loadImage(filename); 16 | } 17 | } 18 | 19 | void display(float xpos, float ypos) { 20 | frame = (frame+1) % imageCount; 21 | image(images[frame], xpos, ypos); 22 | } 23 | 24 | int getWidth() { 25 | return images[0].width; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0000.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0000.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0001.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0001.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0002.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0002.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0003.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0003.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0004.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0004.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0005.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0005.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0006.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0006.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0007.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0007.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0008.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0008.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0009.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0009.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0010.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0010.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0011.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0011.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0012.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0012.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0013.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0013.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0014.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0014.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0015.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0015.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0016.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0016.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0017.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0017.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0018.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0018.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0019.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0019.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0020.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0020.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0021.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0021.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0022.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0022.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0023.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0023.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0024.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0024.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0025.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0025.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0026.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0026.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0027.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0027.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0028.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0028.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0029.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0029.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0030.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0030.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0031.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0031.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0032.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0032.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0033.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0033.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0034.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0034.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0035.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0035.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0036.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0036.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0037.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0037.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0000.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0000.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0001.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0001.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0002.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0002.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0003.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0003.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0004.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0004.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0005.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0005.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0006.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0006.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0007.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0007.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0008.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0008.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0009.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0009.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0010.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0010.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0011.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0011.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0012.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0012.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0013.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0013.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0014.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0014.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0015.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0015.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0016.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0016.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0017.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0017.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0018.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0018.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0019.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0019.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0020.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0020.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0021.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0021.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0022.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0022.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0023.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0023.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0024.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0024.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0025.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0025.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0026.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0026.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0027.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0027.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0028.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0028.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0029.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0029.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0030.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0030.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0031.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0031.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0032.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0032.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0033.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0033.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0034.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0034.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0035.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0035.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0036.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0036.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0037.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0037.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0038.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0038.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0039.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0039.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0040.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0040.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0041.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0041.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0042.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0042.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0043.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0043.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0044.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0044.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0045.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0045.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0046.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0046.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0047.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0047.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0048.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0048.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0049.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0049.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0050.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0050.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0051.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0051.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0052.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0052.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0053.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0053.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0054.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0054.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0055.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0055.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0056.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0056.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0057.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0057.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0058.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0058.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0059.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0059.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/Sequential/data/PT_anim0000.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/Sequential/data/PT_anim0000.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/Sequential/data/PT_anim0001.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/Sequential/data/PT_anim0001.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/Sequential/data/PT_anim0002.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/Sequential/data/PT_anim0002.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/Sequential/data/PT_anim0003.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/Sequential/data/PT_anim0003.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/Sequential/data/PT_anim0004.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/Sequential/data/PT_anim0004.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/Sequential/data/PT_anim0005.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/Sequential/data/PT_anim0005.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/Sequential/data/PT_anim0006.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/Sequential/data/PT_anim0006.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/Sequential/data/PT_anim0007.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/Sequential/data/PT_anim0007.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/Sequential/data/PT_anim0008.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/Sequential/data/PT_anim0008.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/Sequential/data/PT_anim0009.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/Sequential/data/PT_anim0009.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/Sequential/data/PT_anim0010.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/Sequential/data/PT_anim0010.gif -------------------------------------------------------------------------------- /examples/Topics/Animation/Sequential/data/PT_anim0011.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Animation/Sequential/data/PT_anim0011.gif -------------------------------------------------------------------------------- /examples/Topics/Cellular Automata/Wolfram/Wolfram.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Wolfram Cellular Automata 3 | * by Daniel Shiffman. 4 | * 5 | * Simple demonstration of a Wolfram 1-dimensional cellular automata 6 | * When the system reaches bottom of the window, it restarts with a new ruleset 7 | * Mouse click restarts as well. 8 | */ 9 | 10 | CA ca; // An instance object to describe the Wolfram basic Cellular Automata 11 | 12 | void setup() { 13 | size(640, 360, P2D); 14 | frameRate(30); 15 | background(0); 16 | int[] ruleset = {0,1,0,1,1,0,1,0}; // An initial rule system 17 | ca = new CA(ruleset); // Initialize CA 18 | } 19 | 20 | void draw() { 21 | ca.render(); // Draw the CA 22 | ca.generate(); // Generate the next level 23 | 24 | if (ca.finished()) { // If we're done, clear the screen, pick a new ruleset and restart 25 | background(0); 26 | ca.randomize(); 27 | ca.restart(); 28 | } 29 | } 30 | 31 | void mousePressed() { 32 | background(0); 33 | ca.randomize(); 34 | ca.restart(); 35 | } 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /examples/Topics/Create Shapes/BeginEndContour/BeginEndContour.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * BeginEndContour 3 | * 4 | * How to cut a shape out of another using beginContour() and endContour() 5 | */ 6 | 7 | PShape s; 8 | 9 | void setup() { 10 | size(640, 360, P2D); 11 | orientation(LANDSCAPE); 12 | smooth(); 13 | // Make a shape 14 | s = createShape(); 15 | s.beginShape(); 16 | s.fill(0); 17 | s.stroke(255); 18 | s.strokeWeight(2); 19 | // Exterior part of shape 20 | s.vertex(-100,-100); 21 | s.vertex(100,-100); 22 | s.vertex(100,100); 23 | s.vertex(-100,100); 24 | 25 | // Interior part of shape 26 | s.beginContour(); 27 | s.vertex(-10,-10); 28 | s.vertex(10,-10); 29 | s.vertex(10,10); 30 | s.vertex(-10,10); 31 | s.endContour(); 32 | 33 | // Finishing off shape 34 | s.endShape(CLOSE); 35 | } 36 | 37 | void draw() { 38 | background(52); 39 | // Display shape 40 | translate(width/2, height/2); 41 | // Shapes can be rotated 42 | s.rotate(0.01); 43 | shape(s); 44 | } 45 | 46 | -------------------------------------------------------------------------------- /examples/Topics/Create Shapes/ParticleSystemPShape/ParticleSystem.pde: -------------------------------------------------------------------------------- 1 | // The Particle System 2 | 3 | class ParticleSystem { 4 | // It's just an ArrayList of particle objects 5 | ArrayList particles; 6 | 7 | // The PShape to group all the particle PShapes 8 | PShape particleShape; 9 | 10 | ParticleSystem(int n) { 11 | particles = new ArrayList(); 12 | // The PShape is a group 13 | particleShape = createShape(GROUP); 14 | 15 | // Make all the Particles 16 | for (int i = 0; i < n; i++) { 17 | Particle p = new Particle(); 18 | particles.add(p); 19 | // Each particle's PShape gets added to the System PShape 20 | particleShape.addChild(p.getShape()); 21 | } 22 | } 23 | 24 | void update() { 25 | for (Particle p : particles) { 26 | p.update(); 27 | } 28 | } 29 | 30 | void setEmitter(float x, float y) { 31 | for (Particle p : particles) { 32 | // Each particle gets reborn at the emitter location 33 | if (p.isDead()) { 34 | p.rebirth(x, y); 35 | } 36 | } 37 | } 38 | 39 | void display() { 40 | shape(particleShape); 41 | } 42 | } 43 | 44 | -------------------------------------------------------------------------------- /examples/Topics/Create Shapes/ParticleSystemPShape/ParticleSystemPShape.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * ParticleSystemPShape 3 | * 4 | * A particle system optimized for drawing using PShape 5 | */ 6 | 7 | // Particle System object 8 | ParticleSystem ps; 9 | // A PImage for particle's texture 10 | PImage sprite; 11 | 12 | void setup() { 13 | size(640, 360, P2D); 14 | orientation(LANDSCAPE); 15 | // Load the image 16 | sprite = loadImage("sprite.png"); 17 | // A new particle system with 1,000 particles 18 | ps = new ParticleSystem(1000); 19 | 20 | // Writing to the depth buffer is disabled to avoid rendering 21 | // artifacts due to the fact that the particles are semi-transparent 22 | // but not z-sorted. 23 | hint(DISABLE_DEPTH_MASK); 24 | 25 | } 26 | 27 | void draw () { 28 | background(0); 29 | // Update and display system 30 | ps.update(); 31 | ps.display(); 32 | 33 | // Set the particle system's emitter location to the mouse 34 | ps.setEmitter(mouseX,mouseY); 35 | 36 | // Display frame rate 37 | fill(255); 38 | textSize(16); 39 | text("Frame rate: " + int(frameRate),10,20); 40 | 41 | } 42 | 43 | -------------------------------------------------------------------------------- /examples/Topics/Create Shapes/ParticleSystemPShape/data/sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Create Shapes/ParticleSystemPShape/data/sprite.png -------------------------------------------------------------------------------- /examples/Topics/Create Shapes/PathPShape/PathPShape.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * PathPShape 3 | * 4 | * A simple path using PShape 5 | */ 6 | 7 | // A PShape object 8 | PShape path; 9 | 10 | void setup() { 11 | size(640, 360, P2D); 12 | orientation(LANDSCAPE); 13 | // Create the shape 14 | path = createShape(); 15 | path.beginShape(); 16 | // Set fill and stroke 17 | path.noFill(); 18 | path.stroke(255); 19 | path.strokeWeight(2); 20 | 21 | float x = 0; 22 | // Calculate the path as a sine wave 23 | for (float a = 0; a < TWO_PI; a+=0.1) { 24 | path.vertex(x,sin(a)*100); 25 | x+= 5; 26 | } 27 | // The path is complete 28 | path.endShape(); 29 | 30 | } 31 | 32 | void draw() { 33 | background(51); 34 | // Draw the path at the mouse location 35 | translate(mouseX, mouseY); 36 | shape(path); 37 | } 38 | 39 | -------------------------------------------------------------------------------- /examples/Topics/Create Shapes/PolygonPShape/PolygonPShape.pde: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * PrimitivePShape. 4 | * 5 | * Using a PShape to display a custom polygon. 6 | */ 7 | 8 | // The PShape object 9 | PShape star; 10 | 11 | void setup() { 12 | size(640, 360, P2D); 13 | orientation(LANDSCAPE); 14 | // First create the shape 15 | star = createShape(); 16 | star.beginShape(); 17 | // You can set fill and stroke 18 | star.fill(102); 19 | star.stroke(255); 20 | star.strokeWeight(2); 21 | // Here, we are hardcoding a series of vertices 22 | star.vertex(0, -50); 23 | star.vertex(14, -20); 24 | star.vertex(47, -15); 25 | star.vertex(23, 7); 26 | star.vertex(29, 40); 27 | star.vertex(0, 25); 28 | star.vertex(-29, 40); 29 | star.vertex(-23, 7); 30 | star.vertex(-47, -15); 31 | star.vertex(-14, -20); 32 | star.endShape(CLOSE); 33 | } 34 | 35 | void draw() { 36 | background(51); 37 | // We can use translate to move the PShape 38 | translate(mouseX, mouseY); 39 | // Display the shape 40 | shape(star); 41 | } 42 | 43 | -------------------------------------------------------------------------------- /examples/Topics/Create Shapes/PolygonPShapeOOP/PolygonPShapeOOP.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * PolygonPShapeOOP. 3 | * 4 | * Wrapping a PShape inside a custom class 5 | */ 6 | 7 | 8 | // A Star object 9 | Star s1, s2; 10 | 11 | void setup() { 12 | size(640, 360, P2D); 13 | orientation(LANDSCAPE); 14 | // Make a new Star 15 | s1 = new Star(); 16 | s2 = new Star(); 17 | 18 | } 19 | 20 | void draw() { 21 | background(51); 22 | 23 | s1.display(); // Display the first star 24 | s1.move(); // Move the first star 25 | 26 | s2.display(); // Display the second star 27 | s2.move(); // Move the second star 28 | 29 | } 30 | 31 | -------------------------------------------------------------------------------- /examples/Topics/Create Shapes/PolygonPShapeOOP2/Polygon.pde: -------------------------------------------------------------------------------- 1 | // A class to describe a Polygon (with a PShape) 2 | 3 | class Polygon { 4 | // The PShape object 5 | PShape s; 6 | // The location where we will draw the shape 7 | float x, y; 8 | // Variable for simple motion 9 | float speed; 10 | 11 | Polygon(PShape s_) { 12 | x = random(width); 13 | y = random(-500, -100); 14 | s = s_; 15 | speed = random(2, 6); 16 | } 17 | 18 | // Simple motion 19 | void move() { 20 | y+=speed; 21 | if (y > height+100) { 22 | y = -100; 23 | } 24 | } 25 | 26 | // Draw the object 27 | void display() { 28 | pushMatrix(); 29 | translate(x, y); 30 | shape(s); 31 | popMatrix(); 32 | } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /examples/Topics/Create Shapes/PolygonPShapeOOP3/Polygon.pde: -------------------------------------------------------------------------------- 1 | // A class to describe a Polygon (with a PShape) 2 | 3 | class Polygon { 4 | // The PShape object 5 | PShape s; 6 | // The location where we will draw the shape 7 | float x, y; 8 | // Variable for simple motion 9 | float speed; 10 | 11 | Polygon(PShape s_) { 12 | x = random(width); 13 | y = random(-500, -100); 14 | s = s_; 15 | speed = random(2, 6); 16 | } 17 | 18 | // Simple motion 19 | void move() { 20 | y+=speed; 21 | if (y > height+100) { 22 | y = -100; 23 | } 24 | } 25 | 26 | // Draw the object 27 | void display() { 28 | pushMatrix(); 29 | translate(x, y); 30 | shape(s); 31 | popMatrix(); 32 | } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /examples/Topics/Create Shapes/PrimitivePShape/PrimitivePShape.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * PrimitivePShape. 3 | * 4 | * Using a PShape to display a primitive shape (in this case, ellipse). 5 | */ 6 | 7 | 8 | // The PShape object 9 | PShape circle; 10 | 11 | void setup() { 12 | size(640, 360, P2D); 13 | orientation(LANDSCAPE); 14 | // Creating the PShape as an ellipse 15 | // The corner is -50,-50 so that the center is at 0,0 16 | circle = createShape(ELLIPSE, -50, -25, 100, 50); 17 | } 18 | 19 | void draw() { 20 | background(51); 21 | // We can dynamically set the stroke and fill of the shape 22 | circle.setStroke(color(255)); 23 | circle.setStrokeWeight(4); 24 | circle.setFill(color(map(mouseX, 0, width, 0, 255))); 25 | // We can use translate to move the PShape 26 | translate(mouseX, mouseY); 27 | // Drawing the PShape 28 | shape(circle); 29 | } 30 | -------------------------------------------------------------------------------- /examples/Topics/Create Shapes/WigglePShape/WigglePShape.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * WigglePShape. 3 | * 4 | * How to move the individual vertices of a PShape 5 | */ 6 | 7 | 8 | // A "Wiggler" object 9 | Wiggler w; 10 | 11 | void setup() { 12 | size(640, 360, P2D); 13 | orientation(LANDSCAPE); 14 | w = new Wiggler(); 15 | } 16 | 17 | void draw() { 18 | background(255); 19 | w.display(); 20 | w.wiggle(); 21 | } 22 | 23 | 24 | -------------------------------------------------------------------------------- /examples/Topics/Drawing/ContinuousLines/ContinuousLines.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Continuous Lines. 3 | * 4 | * Click and drag the mouse to draw a line. 5 | */ 6 | 7 | void setup() { 8 | size(640, 200); 9 | background(102); 10 | } 11 | 12 | void draw() { 13 | stroke(255); 14 | if(mousePressed) { 15 | line(mouseX, mouseY, pmouseX, pmouseY); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /examples/Topics/Drawing/CustomTool/data/milan.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Drawing/CustomTool/data/milan.jpg -------------------------------------------------------------------------------- /examples/Topics/Drawing/CustomTool/data/paris.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Drawing/CustomTool/data/paris.jpg -------------------------------------------------------------------------------- /examples/Topics/Drawing/Pattern/Pattern.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Patterns. 3 | * 4 | * Move the cursor over the image to draw with a software tool 5 | * which responds to the speed of the mouse. 6 | */ 7 | 8 | void setup() 9 | { 10 | size(640, 360); 11 | background(102); 12 | smooth(); 13 | } 14 | 15 | void draw() 16 | { 17 | // Call the variableEllipse() method and send it the 18 | // parameters for the current mouse position 19 | // and the previous mouse position 20 | variableEllipse(mouseX, mouseY, pmouseX, pmouseY); 21 | } 22 | 23 | 24 | // The simple method variableEllipse() was created specifically 25 | // for this program. It calculates the speed of the mouse 26 | // and draws a small ellipse if the mouse is moving slowly 27 | // and draws a large ellipse if the mouse is moving quickly 28 | 29 | void variableEllipse(int x, int y, int px, int py) 30 | { 31 | float speed = abs(x-px) + abs(y-py); 32 | stroke(speed); 33 | ellipse(x, y, speed, speed); 34 | } 35 | -------------------------------------------------------------------------------- /examples/Topics/Drawing/Pulses/Pulses.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Pulses. 3 | * 4 | * Software drawing instruments can follow a rhythm or abide by rules independent 5 | * of drawn gestures. This is a form of collaborative drawing in which the draftsperson 6 | * controls some aspects of the image and the software controls others. 7 | */ 8 | 9 | int angle = 0; 10 | 11 | void setup() { 12 | size(640, 360); 13 | background(102); 14 | smooth(); 15 | noStroke(); 16 | fill(0, 102); 17 | } 18 | 19 | void draw() { 20 | // Draw only when mouse is pressed 21 | if (mousePressed == true) { 22 | angle += 10; 23 | float val = cos(radians(angle)) * 6.0; 24 | for (int a = 0; a < 360; a += 75) { 25 | float xoff = cos(radians(a)) * val; 26 | float yoff = sin(radians(a)) * val; 27 | fill(0); 28 | ellipse(mouseX + xoff, mouseY + yoff, val, val); 29 | } 30 | fill(255); 31 | ellipse(mouseX, mouseY, 2, 2); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /examples/Topics/Effects/Lens/data/red_smoke.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Effects/Lens/data/red_smoke.jpg -------------------------------------------------------------------------------- /examples/Topics/Effects/Tunnel/data/red_smoke.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Effects/Tunnel/data/red_smoke.jpg -------------------------------------------------------------------------------- /examples/Topics/Effects/UnlimitedSprites/data/Aqua-Ball-48x48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Effects/UnlimitedSprites/data/Aqua-Ball-48x48.png -------------------------------------------------------------------------------- /examples/Topics/Effects/Wormhole/data/texture.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Effects/Wormhole/data/texture.gif -------------------------------------------------------------------------------- /examples/Topics/Effects/Wormhole/data/wormhole.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Effects/Wormhole/data/wormhole.png -------------------------------------------------------------------------------- /examples/Topics/File IO/LoadFile1/LoadFile1.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * LoadFile 1 3 | * 4 | * Loads a text file that contains two numbers separated by a tab ('\t'). 5 | * A new pair of numbers is loaded each frame and used to draw a point on the screen. 6 | */ 7 | 8 | String[] lines; 9 | int index = 0; 10 | 11 | void setup() { 12 | size(200, 200); 13 | background(0); 14 | stroke(255); 15 | frameRate(12); 16 | lines = loadStrings("positions.txt"); 17 | } 18 | 19 | void draw() { 20 | if (index < lines.length) { 21 | String[] pieces = split(lines[index], '\t'); 22 | if (pieces.length == 2) { 23 | int x = int(pieces[0]) * 2; 24 | int y = int(pieces[1]) * 2; 25 | point(x, y); 26 | } 27 | // Go to the next line for the next run through draw() 28 | index = index + 1; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /examples/Topics/File IO/LoadFile2/Record.pde: -------------------------------------------------------------------------------- 1 | class Record { 2 | String name; 3 | float mpg; 4 | int cylinders; 5 | float displacement; 6 | float horsepower; 7 | float weight; 8 | float acceleration; 9 | int year; 10 | float origin; 11 | 12 | public Record(String[] pieces) { 13 | name = pieces[0]; 14 | mpg = float(pieces[1]); 15 | cylinders = int(pieces[2]); 16 | displacement = float(pieces[3]); 17 | horsepower = float(pieces[4]); 18 | weight = float(pieces[5]); 19 | acceleration = float(pieces[6]); 20 | year = int(pieces[7]); 21 | origin = float(pieces[8]); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /examples/Topics/File IO/LoadFile2/data/TheSans-Plain-12.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/File IO/LoadFile2/data/TheSans-Plain-12.vlw -------------------------------------------------------------------------------- /examples/Topics/File IO/SaveFile2/SaveFile2.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * SaveFile 2 3 | * 4 | * This file a PrintWriter object to write data continuously to a file 5 | * while the mouse is pressed. When a key is pressed, the file closes 6 | * itself and the program is stopped. This example won't work in a web browser 7 | * because of Java security restrictions. 8 | */ 9 | 10 | PrintWriter output; 11 | 12 | void setup() 13 | { 14 | size(200, 200); 15 | // Create a new file in the sketch directory 16 | output = createWriter("positions.txt"); 17 | frameRate(12); 18 | } 19 | 20 | void draw() 21 | { 22 | if (mousePressed) { 23 | point(mouseX, mouseY); 24 | // Write the coordinate to a file with a 25 | // "\t" (TAB character) between each entry 26 | output.println(mouseX + "\t" + mouseY); 27 | } 28 | } 29 | 30 | void keyPressed() { // Press a key to save the data 31 | output.flush(); // Write the remaining data 32 | output.close(); // Finish the file 33 | exit(); // Stop the program 34 | } 35 | -------------------------------------------------------------------------------- /examples/Topics/File IO/SaveManyImages/SaveManyImages.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Save Many Images. 3 | * 4 | * The saveFrame() function allows you to save images from 5 | * a program while it is running. This example saves the first 6 | * 50 frames of a program. These images can be imported into 7 | * animation software or QuickTime and then saved as a movie. 8 | */ 9 | 10 | float x = 33; 11 | float numFrames = 50; 12 | 13 | void setup() 14 | { 15 | size(200, 200); 16 | smooth(); 17 | noStroke(); 18 | } 19 | 20 | void draw() 21 | { 22 | background(0); 23 | x += random(-2, 2); 24 | ellipse(x, 100, 80, 80); 25 | if (frameCount <= numFrames) { 26 | saveFrame("circles-####.tif"); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /examples/Topics/File IO/SaveOneImage/SaveOneImage.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Save One Image 3 | * 4 | * The save() function allows you to save an image from the 5 | * display window. In this example, save() is run when a mouse 6 | * button is pressed. The image "line.tif" is saved to the 7 | * same folder as the sketch's program file. 8 | */ 9 | 10 | void setup() 11 | { 12 | size(200, 200); 13 | } 14 | 15 | void draw() 16 | { 17 | background(204); 18 | line(0, 0, mouseX, height); 19 | line(width, 0, 0, mouseY); 20 | } 21 | 22 | void mousePressed() 23 | { 24 | save("line.tif"); 25 | } 26 | -------------------------------------------------------------------------------- /examples/Topics/File IO/TileImages/TileImages.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Tile Images 3 | * 4 | * Draws an image larger than the screen, and saves the image as six tiles. 5 | * The scaleValue variable sets amount of scaling: 1 is 100%, 2 is 200%, etc. 6 | */ 7 | 8 | int scaleValue = 3; // Multiplication factor 9 | int xoffset = 0; // x-axis offset 10 | int yoffset = 0; // y-axis offset 11 | 12 | void setup() { 13 | size(600, 600); 14 | stroke(0, 100); 15 | } 16 | 17 | void draw() { 18 | background(204); 19 | scale(scaleValue); 20 | translate(xoffset * (-width / scaleValue), yoffset * (-height / scaleValue)); 21 | line(10, 150, 500, 50); 22 | line(0, 600, 600, 0); 23 | save("lines-" + yoffset + "-" + xoffset + ".png"); 24 | setOffset(); 25 | } 26 | 27 | void setOffset() { 28 | xoffset++; 29 | if (xoffset == scaleValue) { 30 | xoffset = 0; 31 | yoffset++; 32 | if (yoffset == scaleValue) { 33 | println("Tiles saved."); 34 | exit(); 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /examples/Topics/Fractals and L-Systems/PenroseSnowflake/PenroseSnowflake.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Penrose Snowflake L-System 3 | * by Geraldine Sarmiento (NYU ITP). 4 | * 5 | * This code was based on Patrick Dwyer's L-System class. 6 | */ 7 | 8 | PenroseSnowflakeLSystem ps; 9 | 10 | void setup() { 11 | size(640, 360); 12 | stroke(255); 13 | noFill(); 14 | smooth(); 15 | ps = new PenroseSnowflakeLSystem(); 16 | ps.simulate(4); 17 | } 18 | 19 | void draw() { 20 | background(0); 21 | ps.render(); 22 | } 23 | 24 | 25 | -------------------------------------------------------------------------------- /examples/Topics/Fractals and L-Systems/PenroseTile/PenroseTile.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Penrose Tile L-System 3 | * by Geraldine Sarmiento (NYU ITP). 4 | * 5 | * This code was based on Patrick Dwyer's L-System class. 6 | */ 7 | 8 | PenroseLSystem ds; 9 | 10 | void setup() 11 | { 12 | size(640, 360); 13 | smooth(); 14 | ds = new PenroseLSystem(); 15 | ds.simulate(4); 16 | } 17 | 18 | void draw() 19 | { 20 | background(0); 21 | ds.render(); 22 | } 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /examples/Topics/Fractals and L-Systems/Pentigree/Pentigree.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Pentigree L-System 3 | * by Geraldine Sarmiento (NYU ITP). 4 | * 5 | * This code was based on Patrick Dwyer's L-System class. 6 | */ 7 | 8 | 9 | PentigreeLSystem ps; 10 | 11 | void setup() { 12 | size(640, 360); 13 | smooth(); 14 | ps = new PentigreeLSystem(); 15 | ps.simulate(3); 16 | } 17 | 18 | void draw() { 19 | background(0); 20 | ps.render(); 21 | } 22 | 23 | 24 | -------------------------------------------------------------------------------- /examples/Topics/GUI/ImageButton/data/base.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/GUI/ImageButton/data/base.gif -------------------------------------------------------------------------------- /examples/Topics/GUI/ImageButton/data/down.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/GUI/ImageButton/data/down.gif -------------------------------------------------------------------------------- /examples/Topics/GUI/ImageButton/data/roll.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/GUI/ImageButton/data/roll.gif -------------------------------------------------------------------------------- /examples/Topics/GUI/Scrollbar/data/seedBottom.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/GUI/Scrollbar/data/seedBottom.jpg -------------------------------------------------------------------------------- /examples/Topics/GUI/Scrollbar/data/seedTop.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/GUI/Scrollbar/data/seedTop.jpg -------------------------------------------------------------------------------- /examples/Topics/Geometry/Icosahedra/Dimension3D.pde: -------------------------------------------------------------------------------- 1 | class Dimension3D{ 2 | float w, h, d; 3 | 4 | Dimension3D(float w, float h, float d){ 5 | this.w=w; 6 | this.h=h; 7 | this.d=d; 8 | } 9 | } 10 | 11 | -------------------------------------------------------------------------------- /examples/Topics/Geometry/Icosahedra/Icosahedra.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * I Like Icosahedra 3 | * by Ira Greenberg. 4 | * 5 | * This example plots icosahedra. The Icosahdron is a regular 6 | * polyhedron composed of twenty equalateral triangles. 7 | */ 8 | 9 | Icosahedron ico1; 10 | Icosahedron ico2; 11 | Icosahedron ico3; 12 | 13 | void setup(){ 14 | size(640, 360, P3D); 15 | orientation(LANDSCAPE); 16 | ico1 = new Icosahedron(75); 17 | ico2 = new Icosahedron(75); 18 | ico3 = new Icosahedron(75); 19 | } 20 | 21 | void draw(){ 22 | background(0); 23 | lights(); 24 | translate(width/2, height/2); 25 | 26 | pushMatrix(); 27 | translate(-width/3.5, 0); 28 | rotateX(frameCount*PI/185); 29 | rotateY(frameCount*PI/-200); 30 | stroke(170, 0, 0); 31 | noFill(); 32 | ico1.create(); 33 | popMatrix(); 34 | 35 | pushMatrix(); 36 | rotateX(frameCount*PI/200); 37 | rotateY(frameCount*PI/300); 38 | stroke(150, 0, 180); 39 | fill(170, 170, 0); 40 | ico2.create(); 41 | popMatrix(); 42 | 43 | pushMatrix(); 44 | translate(width/3.5, 0); 45 | rotateX(frameCount*PI/-200); 46 | rotateY(frameCount*PI/200); 47 | noStroke(); 48 | fill(0, 0, 185); 49 | ico3.create(); 50 | popMatrix(); 51 | } 52 | 53 | 54 | -------------------------------------------------------------------------------- /examples/Topics/Image Processing/Blur/data/trees.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Image Processing/Blur/data/trees.jpg -------------------------------------------------------------------------------- /examples/Topics/Image Processing/Brightness/data/wires.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Image Processing/Brightness/data/wires.jpg -------------------------------------------------------------------------------- /examples/Topics/Image Processing/Convolution/data/end.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Image Processing/Convolution/data/end.jpg -------------------------------------------------------------------------------- /examples/Topics/Image Processing/Convolution/data/sunflower.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Image Processing/Convolution/data/sunflower.jpg -------------------------------------------------------------------------------- /examples/Topics/Image Processing/EdgeDetection/data/house.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Image Processing/EdgeDetection/data/house.jpg -------------------------------------------------------------------------------- /examples/Topics/Image Processing/Histogram/data/cdi01_g.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Image Processing/Histogram/data/cdi01_g.jpg -------------------------------------------------------------------------------- /examples/Topics/Image Processing/Histogram/data/ystone08.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Image Processing/Histogram/data/ystone08.jpg -------------------------------------------------------------------------------- /examples/Topics/Image Processing/LinearImage/LinearImage.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Linear Image. 3 | * 4 | * Click and drag mouse up and down to control the signal. 5 | * Press and hold any key to watch the scanning. 6 | * 7 | * Updated 28 February 2010. 8 | */ 9 | 10 | PImage img; 11 | int direction = 1; 12 | 13 | float signal; 14 | 15 | void setup() { 16 | size(200, 200); 17 | stroke(255); 18 | img = loadImage("florence03.jpg"); 19 | img.loadPixels(); 20 | loadPixels(); 21 | } 22 | 23 | void draw() { 24 | if (signal > img.height-1 || signal < 0) { 25 | direction = direction * -1; 26 | } 27 | if (mousePressed) { 28 | signal = abs(mouseY % img.height); 29 | } else { 30 | signal += (0.3*direction); 31 | } 32 | 33 | if (keyPressed) { 34 | set(0, 0, img); 35 | line(0, signal, img.width, signal); 36 | } else { 37 | int signalOffset = int(signal)*img.width; 38 | for (int y = 0; y < img.height; y++) { 39 | arrayCopy(img.pixels, signalOffset, pixels, y*width, img.width); 40 | } 41 | updatePixels(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /examples/Topics/Image Processing/LinearImage/data/florence03.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Image Processing/LinearImage/data/florence03.jpg -------------------------------------------------------------------------------- /examples/Topics/Image Processing/PixelArray/data/ystone08.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Image Processing/PixelArray/data/ystone08.jpg -------------------------------------------------------------------------------- /examples/Topics/Interaction/Follow1/Follow1.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Follow 1. 3 | * Based on code from Keith Peters (www.bit-101.com). 4 | * 5 | * A line segment is pushed and pulled by the cursor. 6 | */ 7 | 8 | float x = 100; 9 | float y = 100; 10 | float angle1 = 0.0; 11 | float segLength = 50; 12 | 13 | void setup() { 14 | size(200, 200); 15 | smooth(); 16 | strokeWeight(20.0); 17 | stroke(0, 100); 18 | } 19 | 20 | void draw() { 21 | background(226); 22 | 23 | float dx = mouseX - x; 24 | float dy = mouseY - y; 25 | angle1 = atan2(dy, dx); 26 | x = mouseX - (cos(angle1) * segLength); 27 | y = mouseY - (sin(angle1) * segLength); 28 | 29 | segment(x, y, angle1); 30 | ellipse(x, y, 20, 20); 31 | } 32 | 33 | void segment(float x, float y, float a) { 34 | pushMatrix(); 35 | translate(x, y); 36 | rotate(a); 37 | line(0, 0, segLength, 0); 38 | popMatrix(); 39 | } 40 | -------------------------------------------------------------------------------- /examples/Topics/Interaction/Follow2/Follow2.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Follow 2. 3 | * Based on code from Keith Peters (www.bit-101.com). 4 | * 5 | * A two-segmented arm follows the cursor position. The relative 6 | * angle between the segments is calculated with atan2() and the 7 | * position calculated with sin() and cos(). 8 | */ 9 | 10 | float[] x = new float[2]; 11 | float[] y = new float[2]; 12 | float segLength = 50; 13 | 14 | void setup() { 15 | size(200, 200); 16 | smooth(); 17 | strokeWeight(20.0); 18 | stroke(0, 100); 19 | } 20 | 21 | void draw() { 22 | background(226); 23 | dragSegment(0, mouseX, mouseY); 24 | dragSegment(1, x[0], y[0]); 25 | } 26 | 27 | void dragSegment(int i, float xin, float yin) { 28 | float dx = xin - x[i]; 29 | float dy = yin - y[i]; 30 | float angle = atan2(dy, dx); 31 | x[i] = xin - cos(angle) * segLength; 32 | y[i] = yin - sin(angle) * segLength; 33 | segment(x[i], y[i], angle); 34 | } 35 | 36 | void segment(float x, float y, float a) { 37 | pushMatrix(); 38 | translate(x, y); 39 | rotate(a); 40 | line(0, 0, segLength, 0); 41 | popMatrix(); 42 | } 43 | -------------------------------------------------------------------------------- /examples/Topics/Interaction/Follow3/Follow3.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Follow 3. 3 | * Based on code from Keith Peters (www.bit-101.com). 4 | * 5 | * A segmented line follows the mouse. The relative angle from 6 | * each segment to the next is calculated with atan2() and the 7 | * position of the next is calculated with sin() and cos(). 8 | */ 9 | 10 | float[] x = new float[20]; 11 | float[] y = new float[20]; 12 | float segLength = 9; 13 | 14 | void setup() { 15 | size(200, 200); 16 | smooth(); 17 | strokeWeight(5); 18 | stroke(0, 100); 19 | } 20 | 21 | void draw() { 22 | background(226); 23 | dragSegment(0, mouseX, mouseY); 24 | for(int i=0; i 0.95) { 15 | color = vec4(1.0, 0.5, 0.5, 1.0); 16 | } else if (intensity > 0.5) { 17 | color = vec4(0.6, 0.3, 0.3, 1.0); 18 | } else if (intensity > 0.25) { 19 | color = vec4(0.4, 0.2, 0.2, 1.0); 20 | } else { 21 | color = vec4(0.2, 0.1, 0.1, 1.0); 22 | } 23 | 24 | gl_FragColor = color; 25 | } -------------------------------------------------------------------------------- /examples/Topics/Shaders/ToonShading/data/ToonVert.glsl: -------------------------------------------------------------------------------- 1 | // Toon shader using per-pixel lighting. Based on the glsl 2 | // tutorial from lighthouse 3D: 3 | // http://www.lighthouse3d.com/tutorials/glsl-tutorial/toon-shader-version-ii/ 4 | 5 | #define PROCESSING_LIGHT_SHADER 6 | 7 | uniform mat4 modelview; 8 | uniform mat4 transform; 9 | uniform mat3 normalMatrix; 10 | 11 | uniform vec3 lightNormal[8]; 12 | 13 | attribute vec4 vertex; 14 | attribute vec3 normal; 15 | 16 | varying vec3 vertNormal; 17 | varying vec3 vertLightDir; 18 | 19 | void main() { 20 | // Vertex in clip coordinates 21 | gl_Position = transform * vertex; 22 | 23 | // Normal vector in eye coordinates is passed 24 | // to the fragment shader 25 | vertNormal = normalize(normalMatrix * normal); 26 | 27 | // Assuming that there is only one directional light. 28 | // Its normal vector is passed to the fragment shader 29 | // in order to perform per-pixel lighting calculation. 30 | vertLightDir = -lightNormal[0]; 31 | } -------------------------------------------------------------------------------- /examples/Topics/Simulate/Flocking/Flock.pde: -------------------------------------------------------------------------------- 1 | // The Flock (a list of Boid objects) 2 | 3 | class Flock { 4 | ArrayList boids; // An arraylist for all the boids 5 | 6 | Flock() { 7 | boids = new ArrayList(); // Initialize the arraylist 8 | } 9 | 10 | void run() { 11 | for (int i = 0; i < boids.size(); i++) { 12 | Boid b = (Boid) boids.get(i); 13 | b.run(boids); // Passing the entire list of boids to each boid individually 14 | } 15 | } 16 | 17 | void addBoid(Boid b) { 18 | boids.add(b); 19 | } 20 | 21 | } 22 | 23 | -------------------------------------------------------------------------------- /examples/Topics/Simulate/Flocking/Flocking.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Flocking 3 | * by Daniel Shiffman. 4 | * 5 | * An implementation of Craig Reynold's Boids program to simulate 6 | * the flocking behavior of birds. Each boid steers itself based on 7 | * rules of avoidance, alignment, and coherence. 8 | * 9 | * Click the mouse to add a new boid. 10 | */ 11 | 12 | Flock flock; 13 | 14 | void setup() { 15 | size(640, 360); 16 | flock = new Flock(); 17 | // Add an initial set of boids into the system 18 | for (int i = 0; i < 150; i++) { 19 | flock.addBoid(new Boid(new PVector(width/2,height/2), 3.0, 0.05)); 20 | } 21 | smooth(); 22 | } 23 | 24 | void draw() { 25 | background(50); 26 | flock.run(); 27 | } 28 | 29 | // Add a new boid into the System 30 | void mousePressed() { 31 | flock.addBoid(new Boid(new PVector(mouseX,mouseY),2.0f,0.05f)); 32 | } 33 | -------------------------------------------------------------------------------- /examples/Topics/Simulate/MultipleParticleSystems/MultipleParticleSystems.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Multiple Particle Systems 3 | * by Daniel Shiffman. 4 | * 5 | * Click the mouse to generate a burst of particles 6 | * at mouse location. 7 | * 8 | * Each burst is one instance of a particle system 9 | * with Particles and CrazyParticles (a subclass of Particle) 10 | * Note use of Inheritance and Polymorphism here. 11 | */ 12 | 13 | ArrayList psystems; 14 | 15 | void setup() { 16 | size(640, 360); 17 | colorMode(RGB, 255, 255, 255, 100); 18 | psystems = new ArrayList(); 19 | smooth(); 20 | } 21 | 22 | void draw() { 23 | background(0); 24 | 25 | // Cycle through all particle systems, run them and delete old ones 26 | for (int i = psystems.size()-1; i >= 0; i--) { 27 | ParticleSystem psys = (ParticleSystem) psystems.get(i); 28 | psys.run(); 29 | if (psys.dead()) { 30 | psystems.remove(i); 31 | } 32 | } 33 | 34 | } 35 | 36 | // When the mouse is pressed, add a new particle system 37 | void mousePressed() { 38 | psystems.add(new ParticleSystem(int(random(5,25)),new PVector(mouseX,mouseY))); 39 | } 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /examples/Topics/Simulate/SimpleParticleSystem/SimpleParticleSystem.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Simple Particle System 3 | * by Daniel Shiffman. 4 | * 5 | * Particles are generated each cycle through draw(), 6 | * fall with gravity and fade out over time 7 | * A ParticleSystem object manages a variable size (ArrayList) 8 | * list of particles. 9 | */ 10 | 11 | ParticleSystem ps; 12 | 13 | void setup() { 14 | size(640, 360); 15 | colorMode(RGB, 255, 255, 255, 100); 16 | ps = new ParticleSystem(1, new PVector(width/2,height/2,0)); 17 | smooth(); 18 | } 19 | 20 | void draw() { 21 | background(0); 22 | ps.run(); 23 | ps.addParticle(mouseX,mouseY); 24 | } 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /examples/Topics/Simulate/SmokeParticleSystem/data/texture.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Simulate/SmokeParticleSystem/data/texture.gif -------------------------------------------------------------------------------- /examples/Topics/Simulate/SmokeParticleSystem/data/texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Simulate/SmokeParticleSystem/data/texture.png -------------------------------------------------------------------------------- /examples/Topics/Textures/TextureCube/data/berlin-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Textures/TextureCube/data/berlin-1.jpg -------------------------------------------------------------------------------- /examples/Topics/Textures/TextureCube/data/uvtex.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Textures/TextureCube/data/uvtex.jpg -------------------------------------------------------------------------------- /examples/Topics/Textures/TextureCylinder/data/berlin-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Textures/TextureCylinder/data/berlin-1.jpg -------------------------------------------------------------------------------- /examples/Topics/Textures/TextureQuad/TextureQuad.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Texture Quad. 3 | * 4 | * Load an image and draw it onto a quad. The texture() function sets 5 | * the texture image. The vertex() function maps the image to the geometry. 6 | */ 7 | 8 | // The next line is needed if running in JavaScript Mode with Processing.js 9 | /* @pjs preload="berlin-1.jpg"; */ 10 | 11 | PImage img; 12 | 13 | void setup() { 14 | size(640, 360, P3D); 15 | orientation(LANDSCAPE); 16 | img = loadImage("berlin-1.jpg"); 17 | noStroke(); 18 | } 19 | 20 | void draw() { 21 | background(0); 22 | translate(width / 2, height / 2); 23 | rotateY(map(mouseX, 0, width, -PI, PI)); 24 | rotateZ(PI/6); 25 | beginShape(); 26 | texture(img); 27 | vertex(-100, -100, 0, 0, 0); 28 | vertex(100, -100, 0, img.width, 0); 29 | vertex(100, 100, 0, img.width, img.height); 30 | vertex(-100, 100, 0, 0, img.height); 31 | endShape(); 32 | } 33 | -------------------------------------------------------------------------------- /examples/Topics/Textures/TextureQuad/data/berlin-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Textures/TextureQuad/data/berlin-1.jpg -------------------------------------------------------------------------------- /examples/Topics/Textures/TextureSphere/data/world32k.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Textures/TextureSphere/data/world32k.jpg -------------------------------------------------------------------------------- /examples/Topics/Textures/TextureTriangle/TextureTriangle.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Texture Triangle. 3 | * 4 | * Using a rectangular image to map a texture onto a triangle. 5 | */ 6 | 7 | // The next line is needed if running in JavaScript Mode with Processing.js 8 | /* @pjs preload="berlin-1.jpg"; */ 9 | 10 | PImage img; 11 | 12 | void setup() { 13 | size(640, 360, P3D); 14 | orientation(LANDSCAPE); 15 | img = loadImage("berlin-1.jpg"); 16 | noStroke(); 17 | } 18 | 19 | void draw() { 20 | background(0); 21 | translate(width/2, height/2, 0); 22 | rotateY(map(mouseX, 0, width, -PI, PI)); 23 | beginShape(); 24 | texture(img); 25 | vertex(-100, -100, 0, 0, 0); 26 | vertex(100, -40, 0, 300, 120); 27 | vertex(0, 100, 0, 200, 400); 28 | endShape(); 29 | } 30 | -------------------------------------------------------------------------------- /examples/Topics/Textures/TextureTriangle/data/berlin-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/examples/Topics/Textures/TextureTriangle/data/berlin-1.jpg -------------------------------------------------------------------------------- /examples/Topics/Vectors/AccelerationWithVectors/AccelerationWithVectors.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Acceleration with Vectors 3 | * by Daniel Shiffman. 4 | * 5 | * Demonstration of the basics of motion with vector. 6 | * A "Mover" object stores location, velocity, and acceleration as vectors 7 | * The motion is controlled by affecting the acceleration (in this case towards the mouse) 8 | * 9 | * For more examples of simulating motion and physics with vectors, see 10 | * Simulate/ForcesWithVectors, Simulate/GravitationalAttraction3D 11 | */ 12 | 13 | // A Mover object 14 | Mover mover; 15 | 16 | void setup() { 17 | size(640,360); 18 | smooth(); 19 | mover = new Mover(); 20 | } 21 | 22 | void draw() { 23 | background(0); 24 | 25 | // Update the location 26 | mover.update(); 27 | // Display the Mover 28 | mover.display(); 29 | } 30 | 31 | -------------------------------------------------------------------------------- /examples/Topics/Vectors/Normalize/Normalize.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Normalize 3 | * by Daniel Shiffman. 4 | * 5 | * Demonstration of normalizing a vector. 6 | * Normalizing a vector sets its length to 1. 7 | */ 8 | 9 | void setup() { 10 | size(640,360); 11 | smooth(); 12 | } 13 | 14 | void draw() { 15 | background(0); 16 | 17 | // A vector that points to the mouse location 18 | PVector mouse = new PVector(mouseX,mouseY); 19 | // A vector that points to the center of the window 20 | PVector center = new PVector(width/2,height/2); 21 | // Subtract center from mouse which results in a vector that points from center to mouse 22 | mouse.sub(center); 23 | 24 | // Normalize the vector 25 | mouse.normalize(); 26 | 27 | // Multiply its length by 50 28 | mouse.mult(150); 29 | 30 | translate(width/2,height/2); 31 | // Draw the resulting vector 32 | stroke(255); 33 | line(0,0,mouse.x,mouse.y); 34 | 35 | } 36 | 37 | 38 | -------------------------------------------------------------------------------- /examples/Topics/Vectors/VectorMath/VectorMath.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Vector 3 | * by Daniel Shiffman. 4 | * 5 | * Demonstration some basic vector math: subtraction, normalization, scaling 6 | * Normalizing a vector sets its length to 1. 7 | */ 8 | 9 | void setup() { 10 | size(640,360); 11 | smooth(); 12 | } 13 | 14 | void draw() { 15 | background(0); 16 | 17 | // A vector that points to the mouse location 18 | PVector mouse = new PVector(mouseX,mouseY); 19 | // A vector that points to the center of the window 20 | PVector center = new PVector(width/2,height/2); 21 | // Subtract center from mouse which results in a vector that points from center to mouse 22 | mouse.sub(center); 23 | 24 | // Normalize the vector 25 | mouse.normalize(); 26 | 27 | // Multiply its length by 150 (Scaling its length) 28 | mouse.mult(150); 29 | 30 | translate(width/2,height/2); 31 | // Draw the resulting vector 32 | stroke(255); 33 | line(0,0,mouse.x,mouse.y); 34 | 35 | } 36 | 37 | 38 | -------------------------------------------------------------------------------- /icons/icon-36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/icons/icon-36.png -------------------------------------------------------------------------------- /icons/icon-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/icons/icon-48.png -------------------------------------------------------------------------------- /icons/icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/icons/icon-72.png -------------------------------------------------------------------------------- /icons/icon-96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/icons/icon-96.png -------------------------------------------------------------------------------- /mode.properties: -------------------------------------------------------------------------------- 1 | name = Android Mode 2 | authorList = [The Processing Foundation](http://android.processing.org/) 3 | url = https://github.com/processing/processing-android 4 | sentence = Create projects with Processing for Android devices 5 | paragraph = This version of the Android Mode is for Processing 3.0+ 6 | imports=processing.mode.java.JavaMode 7 | version = 246 8 | prettyVersion = 3.0-beta4 9 | minRevision = 246 10 | maxRevision = 0 11 | -------------------------------------------------------------------------------- /mode/.gitignore: -------------------------------------------------------------------------------- 1 | AndroidMode.jar 2 | -------------------------------------------------------------------------------- /src/processing/mode/android/BadSDKException.java: -------------------------------------------------------------------------------- 1 | package processing.mode.android; 2 | 3 | @SuppressWarnings("serial") 4 | public class BadSDKException extends Exception { 5 | public BadSDKException(final String message) { 6 | super(message); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/processing/mode/android/DeviceListener.java: -------------------------------------------------------------------------------- 1 | package processing.mode.android; 2 | 3 | import java.util.List; 4 | 5 | public interface DeviceListener { 6 | void stackTrace(final List trace); 7 | 8 | void sketchStopped(); 9 | } 10 | -------------------------------------------------------------------------------- /src/processing/mode/android/Export.java: -------------------------------------------------------------------------------- 1 | package processing.mode.android; 2 | /* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ 3 | 4 | /* 5 | Part of the Processing project - http://processing.org 6 | 7 | Copyright (c) 2009-10 Ben Fry and Casey Reas 8 | 9 | This program is free software; you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License version 2 11 | as published by the Free Software Foundation. 12 | 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software Foundation, 20 | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 | */ 22 | 23 | -------------------------------------------------------------------------------- /src/processing/mode/android/Keys.java: -------------------------------------------------------------------------------- 1 | /* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ 2 | 3 | /* 4 | Part of the Processing project - http://processing.org 5 | 6 | Copyright (c) 2010 Ben Fry and Casey Reas 7 | 8 | This program is free software; you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License version 2 10 | as published by the Free Software Foundation. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software Foundation, 19 | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | */ 21 | 22 | package processing.mode.android; 23 | 24 | import javax.swing.*; 25 | 26 | import processing.app.ui.Editor; 27 | 28 | 29 | @SuppressWarnings("serial") 30 | public class Keys extends JFrame { 31 | Editor editor; 32 | 33 | public Keys(Editor editor) { 34 | this.editor = editor; 35 | setVisible(true); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/processing/mode/android/signing/IApkSignatureProvider.java: -------------------------------------------------------------------------------- 1 | package processing.mode.android.signing; 2 | 3 | import java.io.IOException; 4 | import java.security.GeneralSecurityException; 5 | import java.security.PrivateKey; 6 | import java.security.cert.X509Certificate; 7 | import java.util.jar.JarOutputStream; 8 | 9 | public interface IApkSignatureProvider { 10 | 11 | public void writeSignatureBlock(byte[] message, String signatureAlgorithm, X509Certificate publicKey, 12 | PrivateKey privateKey,JarOutputStream mOutputJar)throws IOException, GeneralSecurityException; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /theme/completion/class_obj-1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/theme/completion/class_obj-1x.png -------------------------------------------------------------------------------- /theme/completion/class_obj-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/theme/completion/class_obj-2x.png -------------------------------------------------------------------------------- /theme/completion/field_default_obj-1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/theme/completion/field_default_obj-1x.png -------------------------------------------------------------------------------- /theme/completion/field_default_obj-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/theme/completion/field_default_obj-2x.png -------------------------------------------------------------------------------- /theme/completion/field_protected_obj-1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/theme/completion/field_protected_obj-1x.png -------------------------------------------------------------------------------- /theme/completion/field_protected_obj-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/theme/completion/field_protected_obj-2x.png -------------------------------------------------------------------------------- /theme/completion/methpub_obj-1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/theme/completion/methpub_obj-1x.png -------------------------------------------------------------------------------- /theme/completion/methpub_obj-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/theme/completion/methpub_obj-2x.png -------------------------------------------------------------------------------- /theme/debug/breakpoint-enabled-1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/theme/debug/breakpoint-enabled-1x.png -------------------------------------------------------------------------------- /theme/debug/breakpoint-enabled-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/theme/debug/breakpoint-enabled-2x.png -------------------------------------------------------------------------------- /theme/debug/continue-enabled-1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/theme/debug/continue-enabled-1x.png -------------------------------------------------------------------------------- /theme/debug/continue-enabled-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/theme/debug/continue-enabled-2x.png -------------------------------------------------------------------------------- /theme/debug/step-enabled-1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/theme/debug/step-enabled-1x.png -------------------------------------------------------------------------------- /theme/debug/step-enabled-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/theme/debug/step-enabled-2x.png -------------------------------------------------------------------------------- /theme/variables-1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/theme/variables-1x.png -------------------------------------------------------------------------------- /theme/variables-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/processing-android/c2bbe93250572e32d394e5e072a1f8b0e82ee153/theme/variables-2x.png --------------------------------------------------------------------------------