Processing
文章平均质量分 81
会思考的猴子
这个作者很懒,什么都没留下…
展开
-
Processing HE_Mesh 概述
一 、core1.Ref_WB_ProgressReporter二、geombounding 1.Ref_WB_AABBTree2D2.Ref_WB_AABBTree3D3.Ref_WB_Circle_BoundingCircle4.Ref_WB_IndexedAABBTree2D5.Ref_WB_Inde...原创 2020-03-31 10:24:38 · 489 阅读 · 0 评论 -
Box2D for processing Create circle
import shiffman.box2d.*;import org.jbox2d.collision.shapes.*;import org.jbox2d.common.*;import org.jbox2d.dynamics.*;ArrayList<Circle> circles;Box2DProcessing box2d;void setup(){ ...原创 2020-03-30 18:37:37 · 559 阅读 · 0 评论 -
Processing FontAnimation
ArrayList<Vehicle> vehicles;int[] list;PFont font;String typedKey = "为人民服务";void setup() { size(1920,1080); frameRate(30); stroke(0,128); strokeWeight(2); vehicles = new ArrayLis...原创 2020-03-26 23:26:36 · 279 阅读 · 1 评论 -
Box2d For Processing
1.ApplyForceAttractMouse2.ApplyForceSimpleWind 施加一个方向力3.AttractionApplyForce 吸附到黑球4.Blobby4.box2d_exercise 用于练习 基本代码5.box2d_exercise_solved 鼠标点击产生粒子...原创 2020-03-24 16:42:50 · 904 阅读 · 0 评论 -
Pixelflow 概述
二 FlowField三 FlowFieldParticles四 Fluid2DFluid_Basic:CustomParticles:FirstBlood:GetStarted:原创 2020-03-23 13:56:55 · 2121 阅读 · 0 评论 -
Pixelflow GetStart(二)
import com.thomasdiewald.pixelflow.java.DwPixelFlow;import com.thomasdiewald.pixelflow.java.fluid.DwFluid2D;import com.thomasdiewald.pixelflow.java.fluid.DwFluidParticleSystem2D;private class M...原创 2020-03-23 00:02:33 · 775 阅读 · 0 评论 -
PixelFlow GetStart(一)
鼠标跟随:import com.thomasdiewald.pixelflow.java.DwPixelFlow;import com.thomasdiewald.pixelflow.java.fluid.DwFluid2D;import processing.core.*;import processing.opengl.PGraphics2D; // fluid...原创 2020-03-22 22:17:48 · 1044 阅读 · 1 评论 -
Processing 入门教程(七)3D地球
直接看注释吧,不啰嗦勒void setup() { // 全屏 fullScreen(P3D); // 文字大小 textSize(32);}float timer = 0;void draw() { //背景 background(0); // 绿色边框 stroke(#74F599); //不设置填充 noFill(); // 环境光 ...原创 2018-12-10 21:40:40 · 4184 阅读 · 0 评论 -
我学 Processing 用到的优质网站推荐
processing 官方视频 教程:https://www.youtube.com/user/shiffman/featured 文档学习网站:1. https://funprogramming.org/ 150多个知识点这个是最好用的processing学习网站2. https://blog.csdn.net/losacii/article/category...原创 2018-12-10 22:19:27 · 5230 阅读 · 0 评论 -
Processing 入门教程(八) random()随机数之美
random 这个函数有个坑, 你可以直接定义stroke(random(255)); 不会报错,但得出来的不是随机数 equal==》 stroke(255),是个灰色的颜色;stroke(random(255),random(255),random(255)); 对应 R,G,B,写完整不要偷懒所以下面代码的 转 int 在processing 3 中也是可以省略的 void...原创 2018-12-11 20:42:38 · 11518 阅读 · 3 评论 -
Processing 入门教程(九) 动画
float circle_x = 0;void setup() { size(400,200); noStroke(); fill(#C1FF3E);}float radiu = 50;void draw() { background(#1BB1F5); ellipse(circle_x-radiu/2,radiu/2, radiu, radiu);...原创 2018-12-11 20:55:19 · 2834 阅读 · 0 评论 -
Processing 入门教程(十) 弹弹球
实现一个球在屏幕内不停的反弹力效果,跟大神写的就是不一样,感觉自己写的真的是渣啊,不过写完之后发现跟大神的思路基本是一样的,开心心我自己的代码:float circle_x = 0;void setup() { size(400, 400); noStroke(); fill(#C1FF3E);}float moveX = 2;float moveY = 2;fl...原创 2018-12-11 21:39:21 · 7838 阅读 · 0 评论 -
Processing 入门教程(十一) 彩虹桥
刚好写到这,有一个需要注意的地方,在这个 draw()如果有background()这个方法的 话,意味着每次都会刷新面板;做动画必不可少的,不然会一直叠加叠加叠加颜色void setup() { size(300, 300); }void draw() { //background(#1BB1F5); int radiu = int(random(200,277)...原创 2018-12-11 21:59:06 · 2280 阅读 · 0 评论 -
Processing 入门教程(三十二)鼠标拖动事件
int x = 100;int y = 100;int sz = 100;color bgcolor;void setup() { size(400, 300); colorMode(HSB); noStroke(); smooth(); fill(random(255), 100, 200); bgcolor = color(random(255), 1...原创 2018-12-18 20:27:37 · 4312 阅读 · 0 评论 -
Processing 入门教程(三十三) 判断鼠标有没有在矩形范围内并响应鼠标事件
int amt = 50;int[] x1 = new int[amt];int[] x2 = new int[amt];int[] y1 = new int[amt];int[] y2 = new int[amt];color[] c = new color[amt];color bgcolor;void setup() { size(400, 300); col...原创 2018-12-18 20:42:14 · 2603 阅读 · 0 评论 -
Processing 入门教程(三十四) Audio 音频播放
1. 初始化new一个导入的这个音乐库的引擎2.new一个音频的类对象3.loadSample 加载资源4.trigger() 有点类似 unity 的播放音频的Play();结束的时候别忘了 写上Stop()函数import ddf.minim.*;// This program only runs on the Java mode on the IDE,// not...原创 2018-12-18 21:21:20 · 4731 阅读 · 0 评论 -
Processing 入门教程(三十五)调取摄像头
// Run this program only in the Java mode inside the IDE,// not on Processing.js (web mode)!!import processing.video.*;Capture cam;void setup() { size(600, 300); cam = new Capture(this, 32...原创 2018-12-18 22:22:54 · 6237 阅读 · 1 评论 -
Processing 入门教程(三十六)视频播放
// Note: this program runs only in the Processing IDE, not in the browserimport processing.video.*;String PATH = "/path/to/one/of/your/movies/blabla.mp4";Movie mov;void setup() { size(640, 36...原创 2018-12-18 22:51:06 · 4945 阅读 · 0 评论 -
Arduino 与 Processing 互动编程艺术(一) Serial
Arduino 发送消息,Processing 接收消息该Demo为 Arduino控制灯亮时processing控制球向右转,灯灭processing球向左转,在processing上鼠标左键拖动控制球的密度,鼠标右键保存图片Arduino端:每隔5秒灯亮,每隔5秒灯灭,电路图太简单,我就不展示了Arduino Code:int ledPin = 13;void setu...原创 2019-01-09 18:36:18 · 5127 阅读 · 5 评论 -
Processing vector 桌球算法练习
float xSpeed = 3;float ySpeed = 3;float x = 50;float y = 100;void setup(){size(400,400);}void draw(){ background(255); x += xSpeed; y += ySpeed; //translate(width/2,height/2); if(...原创 2019-04-16 23:17:56 · 676 阅读 · 0 评论 -
Processing 入门教程(十五)noise()和 random()的区别
noise():(我理解的是得到一个无规律的小范围变化的随机值)返回指定坐标处的Perlin噪声值。Perlin噪声是随机序列发生器,产生比标准random()函数更自然,谐波的数字序列。它由Ken Perlin在20世纪80年代开发,并已用于图形应用程序,以生成程序纹理,形状,地形和其他看似有机的形式。与随机()相比函数,Perlin噪声定义在无限的n维空间中,其中每对坐标对应一个固定的半...原创 2018-12-12 23:15:27 · 5489 阅读 · 0 评论 -
Processing 入门教程(三十) lerpColor颜色渐变
1.不用lerpColor 的颜色渐变 noStroke();colorMode(RGB, 100);for (int i = 0; i < 100; i++) { for (int j = 0; j < 100; j++) { stroke(i, j, 0); point(i, j); }}效果图如下:noStroke();colo...原创 2018-12-16 20:18:44 · 12538 阅读 · 0 评论 -
Processing 入门教程(二十九) get() 得到图像像素点颜色
void setup() { size(500, 400); for(int x = 0; x < width; x++) { for(int y = 0; y < 120; y++) { float r = map(noise(x / 80.0, y / 80.0, 10.0), 0, 1, 0, 255); float g = map...原创 2018-12-16 19:51:36 · 4058 阅读 · 0 评论 -
Processing 入门教程(二十八) 3D点云
代码很简单就不写注释了,效果感觉还不错就放出来了,用这个能实现很棒的交互效果int amount = 300;int[] x = new int[amount];int[] y = new int[amount];int[] z = new int[amount];void setup() { size(500, 400, P3D); background(0); no...原创 2018-12-16 19:42:18 · 2109 阅读 · 0 评论 -
Processing入门教程(五)鼠标键盘事件
void setup() { size(584, 414, P3D); frameRate(60); line(30, 20, 0, 85, 20, 15); stroke(126); line(85, 20, 15, 85, 75, 0); stroke(255); line(85, 75, 0, 30, 75, -50);}void draw() {}v...原创 2018-12-09 18:53:39 · 4945 阅读 · 0 评论 -
Processing 入门教程(四)kinect 人影互动(1)
家里没有kinect ,只能先用点来做测试了,明天去公司把它完善了ParticleSystem ps;Particle p ;int particleDensity;void setup() { size(545, 414); ps = new ParticleSystem(); particleDensity =50;}void draw() { backgro...原创 2018-12-09 17:22:42 · 7384 阅读 · 4 评论 -
Processing入门教程(三)碰撞
import java.util.*;ParticleSystem ps;Repeller repeller; void setup() { size(640,360); ps = new ParticleSystem(new PVector(width/2,50)); repeller = new Repeller(width/2-20,height/2);} voi...原创 2018-12-09 16:57:52 · 5099 阅读 · 2 评论 -
Processing 入门教程(三十七)图层动画
int frames = 20;int framesToSave = 0;// 设置当前有20个图层PGraphics pg[] = new PGraphics[frames];void setup() { size(500, 500); prepareGraphics();}void draw() { int currFrame = frameCount % fram...原创 2018-12-20 00:05:55 · 3006 阅读 · 0 评论 -
Processing 入门教程(十四) 群体对象旋转管理
float rot = 0;void setup() { size(400, 400); background(100, 200, 50); smooth(); noStroke();}void draw_rotating_rectangle(float x, float y, float rect_size, float r) { translate(x, y);...原创 2018-12-12 22:44:43 · 2043 阅读 · 3 评论 -
Processing 入门教程(十三) resetMatrix()
float r = 0;void setup() { size(400, 400); background(255); noStroke(); fill(0); rectMode(CENTER);}void draw() { background(255); //该变轴,平移 translate(100, 100); //以平移的轴的 (0,0)点旋转...原创 2018-12-12 20:59:09 · 1180 阅读 · 0 评论 -
Processing 入门教程(十二)图形残影效果
float r = 0;float backR;float backG;float backB;void setup() { size(400, 400); backR = random(0, 100); backG = random(0, 100); backB = random(0, 100); background(backR, backG, backB);...原创 2018-12-12 20:30:57 · 5999 阅读 · 1 评论 -
Processing入门教程(二) Kinect 粒子系统
接着上一篇的入门教程一,我们这次将Kinect 也结合进来环境: processing 3.4 和 kinect v2找到深度图的中心点标记出来,将粒子系统跟随这个中心点入口:import KinectPV2.*;KinectPV2 kinect2;float minThresh = 518;float maxThresh = 1184;PImage img;int o...原创 2018-12-07 16:48:21 · 6503 阅读 · 4 评论 -
Processing 入门教程(六)宇宙飞船大战外星人
飞船跟随鼠标移动,按 a键 发射子弹 主类:float x, y;//x,y是圆心坐标float easing = 0.01;Particle p;float diameterWidth = 32.0, diameterHeight = 4.0;void draw_a_UFO(float x, float y){ fill(255, 0, 0); elli...原创 2018-12-09 21:25:55 · 2489 阅读 · 0 评论 -
Processing 入门教程(十七) Map,Sin
float a = 0;void setup() { size(500, 300); background(0); colorMode(HSB, 100); noStroke();}void draw() { float x = map(sin(a)*sin(a*0.8), -1, 1, 0, width); float y = map(sin(a*1.1+1....原创 2018-12-15 16:12:20 · 2530 阅读 · 0 评论 -
Processing 入门教程(十八) copy()
void setup() { size(940, 705); background(#B1FF0A); PImage img = loadImage("AddImage.jpg"); image(img, 0, 0, width, height); copy(600, 100, 200, 200, width/2, height/2, 200, 200); stroke(...原创 2018-12-15 17:09:10 · 731 阅读 · 0 评论 -
Processing 入门教程(二十七) bezier
bezier(x1, y1, x2, y2, x3, y3, x4, y4)bezier(x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4) 参数 X1 float:第一个锚点的坐标 Y1 float:第一个锚点的坐标 Z1 float:第一个锚点的坐标...原创 2018-12-16 19:22:03 · 1255 阅读 · 0 评论 -
Processing入门教程(二十六) sin()and cos()
sin() 计算角度的正弦值。此函数需要以弧度(0到6.28之间的值)提供角度参数的值。值的返回范围为-1到1。cos() 计算角度的余弦值。此函数需要以弧度(0到PI * 2的值)提供角度参数的值。值的返回范围为-1到1。例子:float a = 0;float b = 0;float co = 0;void setup() { background(255); c...原创 2018-12-16 18:55:27 · 1611 阅读 · 0 评论 -
Processing 入门教程(二十五) randomSeed
设置random()的种子值。默认情况下,每次运行程序时random()都会产生不同的结果。将seed参数设置为常量,以便在每次运行软件时返回相同的伪随机数。说通俗点就是 你这次随机产生的结果,你觉得后续还可能需要用,保存这个 seed 的值,例如6689289 randomSeed(6689289) 每次产生的结果都是一样的size(500, 400);colorMode(HSB...原创 2018-12-16 18:22:07 · 1853 阅读 · 0 评论 -
Processing 入门教程(二十四) lerp函数
lerp(a,b,t) ===> a 开始值 b 结束值 t 时间 从a到b 进行差值运算float x = 0;float y = 0;float a = 0;void setup() { size(500, 400, P3D);}void draw() { background(20); x = lerp(x, mouseX, 0.1); y = ...原创 2018-12-16 17:53:39 · 2661 阅读 · 0 评论 -
Processing 入门教程(二十三) 3D
box(size) => 创造一个正方体box(x,y,z) => 自定义矩形rotateY 绕Y轴旋转PI/6 == 30float a = 0;float r = 0;void setup() { size(400, 400, P3D);}void draw() { background(80); // translate x,y,z...原创 2018-12-16 17:31:17 · 2762 阅读 · 0 评论