processing

Continuous image loading/processing & display on button click (in Swing)

喜你入骨 提交于 2019-12-25 11:35:54
问题 I have trouble with continuous image loading&processing&display in Swing: Below there is simple case where clicking a button causes my program to grab frame from webcam and then display this picture in jlabel. It works as it should, but i have to consecutively click this "Start" button in order to get new image(frame) shown. private void StartActionPerformed(java.awt.event.ActionEvent evt) { displayed_img = this.getPIC_COLOR(player); img_field.setIcon(new ImageIcon(displayed_img)); } Im more

How to restart a sketch project in processing?

怎甘沉沦 提交于 2019-12-25 09:16:01
问题 I am working on a Processing project, but I don´t know how to restart the project once it is over. I have searched and found that the setup() method will make it. But it's not working. Can anyone help me. I would like the sketch to restart by itself once it is finished. /* OpenProcessing Tweak of *@*http://www.openprocessing.org/sketch/59807*@* */ /* !do not delete the line above, required for linking your tweak if you upload again */ // // outline: takes an image (image.jpg) and creates a

Ace editor Processing mode?

南笙酒味 提交于 2019-12-25 08:48:19
问题 I uploaded a processing file to github. I want to show the code on my website. So I implement ACE editor in my site and ajaxed my proecessing code to the ace editor. But there is a problem. I want the code showed on my look as the code show in Processing IDE. But Ace editor support java language but no mode for processing. How can I solve this problem ? I could not find any package for Ace processing mode. 回答1: http://hello.processing.org/editor/ uses Ace, and it have a mode for processing

p5js sketch inside wordpress page

妖精的绣舞 提交于 2019-12-25 07:58:53
问题 I'm trying to insert created canvas to the div element to the manually created page template in wordpress: template-custom.php <?php get_header('custom') ?> <div id='createdCanvas' width='600px' height='600px'></div> <?php get_footer() ?> sketch.js function setup() { var WIDTH = 500; var HEIGHT = 500; var myCanvas = createCanvas(WIDTH, HEIGHT); myCanvas.parent('createdCanvas'); } I've wrote it by the p5js reference. The canvas displayed on the page, but by default at the of the page. Just one

Array of moving objects stacking up

旧街凉风 提交于 2019-12-25 07:52:07
问题 My question concerns creating an array of moving objects. The goal is to have each created "symbol" starts at x=200 when created and then moves along the x-axis. This is possible by creating individual objects, though when I try to make them appear in an array they just appear on top of each other (made the balls transparent so you can see them stack). Is there a way to create an array of individual array objects so that this doesn't happen. int numSymbols = 100; int symbolXPos; int i; Symbol

WebRTC 的音频处理流水线

情到浓时终转凉″ 提交于 2019-12-25 07:44:44
基于 RTC 场景下要解决的声音的问题,WebRTC 有一个大体如下图所示的音频处理流水线: WebRTC 的音频处理流水线,不是一次性建立起来的,而是分阶段分步骤建立的。整体而言,可以认为这个流水线分两个阶段建立,或者可以认为这个流水线分为两部分:一部分可称为静态流水线,另一部分可称为动态流水线,或者也可以称为前端和后端。静态流水线,在某个时间点建立一次,随后在整个 WebRTC 通信过程中基本保持不变;动态流水线则在通信过程中,可能出现较为频繁的变动,如本地打开或禁用录制启动发送或停止发送音频数据,远端发送者加入或退出频道等,都会改变动态流水线。 如此,WebRTC 的音频处理流水线大致如下图所示: WebRTC 音频的静态流水线,建立之后,其相关节点状态由 AudioState 维护和管理。WebRTC 音频的静态流水线,主要包括 AudioDeviceModule , AudioProcessing ,和 AudioMixer 等,其中 AudioDeviceModule 用于采集和播放音频数据, AudioProcessing 主要用于对录制的音频数据做初始处理,如回声消除,降噪等, AudioMixer 主要用于对远端发送过来的音频数据做混音。 WebRTC 音频的静态流水线在 WebRtcVoiceEngine 初始化时建立: void

Using a for loop to repeat concentric ellipses

前提是你 提交于 2019-12-25 07:23:43
问题 This is my first time posting here, bear with me as I might mess up the formatting. With the code below, I am trying to get the 2 overlapping/concentric ellipses to repeat a random number of times (in this case I chose 1 through 20) around random places on the 400x400 canvas. I've tried many different things but what keeps happening is the concentric ellipses become scattered and it becomes a mess of color and unrecognizable shapes. The fill must stay within the outside loop and the drawing

rotate/point with sub-pixel precision

荒凉一梦 提交于 2019-12-25 06:49:58
问题 How may I get sub-pixel precision in position of the points plotted below? Only integer precision is used -- causing the observed wobble of the moving points. int amount = 300; float[] x = new float[amount]; float[] y = new float[amount]; float[] z = new float[amount]; void setup() { size(500, 400, P3D); stroke(255); strokeWeight(1); for(int i = 0; i<amount; i++) { x[i] = float(random(-150, 150)); y[i] = float(random(-150, 150)); z[i] = float(random(-150, 150)); } } void draw() { background(0

Processing: How can I color the squares drawn by my 2D Array in different colors?

岁酱吖の 提交于 2019-12-25 05:04:04
问题 I'm trying to make a game board for bomberman in processing with a 2D array. (The final version will have colors or bitmaps and the properties of each block type and will define the walking space that the player has.) I want this game board which consists of 11 rows and 11 columns to have squares of different colors for each block type in the game. ( j being a solid block, i being walking space and k being a breakable block, as you'll see in the array) I've already managed to draw the array

Need help adding a class and animations to a simple pet drawing?

喜你入骨 提交于 2019-12-25 04:10:18
问题 float x = 100; float y = 100; float p = 150; float l = 10; float a = 100; float b = 100; float n =20; int value = 255; int r = 150; int t = 100; int s = 100; int w = 60; int h = 60; int z = 11; int eyeSize = 10; int pigNose = 30; int pigBody = 30; int pigEars = 35; int pigTail = 20; int otherpigTail = 200; int speed = 1; void setup () { size (600, 600); a = width/2.5; b = height/2; } void draw() { background(184, 233, 249); //Draw legs stroke(0); fill(249, 137, 244); rect(x+(2*w), y+h/3.5, z,