processing

The operator < is undefined for the argument type(s) boolean, int

佐手、 提交于 2019-12-14 04:12:29
问题 I am new to processing and I am having trouble with this. I keep getting an error message for the bolded part of the code below. Is my syntax wrong? void block(int x, int y, int s, color tinto) { fill(tinto); for (int i = 0; i < 3; i++) { triple(x, y+i*s, s, tinto); } if (0 < i < 3 && 6 < i < 9) { // HERE tinto = 255; } else { tinto = tinto - 200; } } 回答1: In Java, to check if a variable is in a range you have to divide the statement into two parts, like this: if (0 < i && i < 3 && 6 < i && i

Rotating, inverting and translating a PShape object in Processing

一笑奈何 提交于 2019-12-14 03:53:32
问题 I would like to: translate , invert and rotate a single quadrilateral (PShape object) multiple times then change the height of one of its 2 top vertices so as the whole thing act as an articulated arm that can be bent either to the right or the left . To be as clear as possible I've made some graphics. I know that I can: translate the quadrilateral using translate() flip (invert) it with scale(1, -1) rotate it using the atan2() function PROBLEM When combining the 3 together I end up with this

Change object by pressing button while showing animation

只谈情不闲聊 提交于 2019-12-14 03:22:29
问题 I'm trying to add animation in my code. What I have so far is an object that can be changed by pressing a button. So every time you press the button, the object changes (it is a tree and I'm changing its branches). Is it possible to add some kind of animation like snow? The problem with that is that I have to put it inside the draw method so it will be called automatically and make us think that it is animation. Thus, I also have to add the background / button and everything all the time. But

How to make a Processing Sketch with external libraries and files work on a website?

瘦欲@ 提交于 2019-12-14 02:19:52
问题 So I have made a game using Processing and have used 2 java libraries (minim for sound and java.util.map for a hashmap), as well as having many external image and sound files which the game uses. I want to put the game on my website, in a way that you can play it without downloading it. I have not been able to find a way of ding this so I thought I'd ask here. 回答1: Short answer: you can't. You can deploy basic Processing sketches using Processing.js, but that won't work if your sketch

How to use public class frome .java file in other processing tabs?

耗尽温柔 提交于 2019-12-14 01:46:40
问题 My problem seems to be trivial, but after 2 hours of googling I came with nothing. I have Processing sketch. The first, main tab contains: Foo bar; void setup() { } void draw() { } The second is Foo.java file: package processing.core; import java.io.Serializable; import processing.core.PApplet; public class Foo implements Serializable { } After I try to run this program I get at the first line of the first file: Cannot find a class or type "Foo" The second file is Foo.java, the first has some

High-Resolution Processing Output

微笑、不失礼 提交于 2019-12-14 00:35:56
问题 I'm looking for help with the programming language/environment Processing. I'm fairly new to Processing and I am experimenting with a piece of code from someone over at openprocessing.org. I really like the visual results this code delivers and I would like to further work with it. Unfortunately, the output is very low resolution. Hence I'm looking for someone who might be able to help me figure out how to a) Increase the size or resolution of the shapes generated and b) save everything as a

OLAP(On-line Analytical Processing,联机分析处理)

删除回忆录丶 提交于 2019-12-13 18:44:32
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 数据立方体   关于数据立方体(Data Cube),这里必须注意的是数据立方体只是多维模型的一个形象的说法。立方体其本身只有三维,但多维模型不仅限于三维模型,可以组合更多的维度,但一方面是出于更方便地解释和描述,同时也是给思维成像和想象的空间;另一方面是为了与传统关系型数据库的二维表区别开来,于是就有了数据立方体的叫法。所以本文中也是引用立方体,也就是把多维模型以三维的方式为代表进行展现和描述,其实上Google图片搜索“OLAP”会有一大堆的数据立方体图片,这里我自己画了一个: OLAP    OLAP(On-line Analytical Processing,联机分析处理) 是在基于数据仓库多维模型的基础上实现的面向分析的各类操作的集合。可以比较下其与传统的OLTP(On-line Transaction Processing,联机事务处理)的区别来看一下它的特点: OLAP与OLTP 数据处理类型 OLTP OLAP 面向对象 业务开发人员 分析决策人员 功能实现 日常事务处理 面向分析决策 数据模型 关系模型 多维模型 数据量 几条或几十条记录 百万千万条记录 操作类型 查询、插入、更新、删除 查询为主 OLAP的类型  

strange error in java reflection (processing)

天涯浪子 提交于 2019-12-13 18:06:07
问题 From an answer in this my previous question: how to create in best way an instance from the class object I'm trying to do what he suggests but I don't know how to fix the error. Code: import java.lang.reflect.*; class Foo { public <T> T create(float x, float y, Class<T> myClass) throws Exception { Constructor<T> toCall = myClass.getConstructor(float.class, float.class); return toCall.newInstance(x, y); } } class Dog { public Dog(float x, float y) { print(x); print(y); } } Foo foo = new Foo();

Processing cannot find library

江枫思渺然 提交于 2019-12-13 17:29:19
问题 I've tried importing from a jar file (quickhull3d for example) in Processing 2.2.1 and 3.2.1 on Linux and Mac based on the instructions given here My directory structure looks like this ../Processing/Sketchbook/libraries/quickhull3d/library/quickhull3d.jar The Processing IDE preferences set the sketchbook location to ../Processing/Sketchbook In my .pde file, I have the opening line import quickhull3d.*; and I get the error: No library found for quickhull3d Libraries must be installed in a

Find circles in image without using Hough transform

纵饮孤独 提交于 2019-12-13 16:19:24
问题 I want to find the circles in the below image.I tried using OpenCV's Hough circle detection but it is not giving the proper results. Is there any other way to find circles? Here is sample code vector<Vec3f> circles; Mat src_gray,te; cvtColor(tImg, src_gray, CV_BGR2GRAY); GaussianBlur(src_gray, src_gray, Size(9, 9), 2, 2); Canny(src_gray, te, 40, 240, 3); /// Apply the Hough Transform to find the circles HoughCircles(te, circles, CV_HOUGH_GRADIENT, 1, te.rows / 10, 120, 9, 5, 25); 回答1: Take