I've been struggling with this issue for a while now. I have a certain sketch that's in 3D that runs in a browser, but it looks like crap due to all the aliasing. Is there a way to smooth this? I've tried calling both smooth and hint functions and changing between P3D and OPENGL renderers (although I'm not clear what's happening when I do that) but nothing seems to work. What am I doing wrong?
As a matter of fact, I can't get the 3D sketches to be anti-aliased anywhere, even on my destkop version of Processing. How can all this be solved?
this is kind of beginners question, but I can't find a solution to it.
So, I know how to install a library the "normal" way, I just extract the folder "libraryName" to ".../Processing/libraries" folder and it works. But since I want my sketch to be runnable on other computers (I'm exporting an exe) I don't know where to install the libraries it's using. I know I should put it somewhere inside the "sketchName" folder, but I'm not sure where so please help me.
I have the latest Processing version (2.0b7) and I tried to run some 3D code. That code runs perfectly on my brother's laptop (which is in fact older than mine), but on my computer I get the "OpenGL error 1280 at bot beginDraw(): invalid enumerant" error.
Although I get the error, the sketch runs, but it's very slow and the smooth() function (that is run by default in this Processing version) is just not working (and this is very important to me), my sketch is obviously not antialiased when compared to the sketch on my brother's computer.
I really don't know how to fix this, I downloaded the latest drivers for my Nvidia GeForce Gt 425M card, but the problem won't go away.
Here's the code I've been trying to run. Just to mention it one more time, it's NOT about the code because this same code runs perfectly on my brother's laptop, it runs at normal speed with the smoothing filter working.
So, here's the thing, I've got two issues with P3D:
1. using the smooth() function doesn't have any effect on my sketch
2. when I run the sketch, a window pops up (as usual), but for the actual result I have to wait a few seconds, why does it need so much time?
Here's a simple example from processing.org that contains both of my problems:
size(100, 100, P3D);
smooth();
translate(58, 48, 0);
rotateY(0.5);
noFill();
box(40);
I'm using Processing 2.0b7 on Win7
Btw, when I try to run some P3D sketches at
http://www.openprocessing.org/, they seem to work fine in the browser (smooth() works and sketch starts almost immediately), but when I copy the code and run it on my PC, the two problems appear.
I'm familiar with blending options when dealing with images, but is it possible to something like this?:
So, I'd draw three ellipses and each of them would have a different fill (red, green and blue) and all of them would have a LIGHTEN type of blend (that's the one from Photoshop, I don't know if it exists in Processing).
So yeah, I've made an exe about a month ago and it ran perfectly. I put all the necessary files in the exe folder (like jpgs and pngs) and it was all okay and it still works to this day.
Today I wrote a new program and tried to export it, but when I try to run the exe, I get the "Could not create the Java Virtual Machine." error and have no clue what to do about it.
I suppose it has to do something with
Please help, this is really important to me and I don't know how to solve this, thanks.
EDIT:
I tried to export the same program on my brothers computer and it runs fine on both computer so I guess my computer has some problems while export the application, how do I solve that?
First I'm going to introduce you to my project so you can understand my problem better.
The main idea of my project is to draw a windmill and rotate it. There are many other specifications regarding it's movement like the deceleration on the second click, randomizing it's speed etc. (I solved all this problems), but you don't need to know this stuff, they're not the issue. First, I was given a PNG picture of a windmill and I just loaded it, put it in the sketch and rotated it in every frame. It worked fine, but it's just too choppy. The sketch dimensions have to be 1920x1080 because that are the dimensions of the monitor it will finally be ran on.
Here is the very simplified version of my code, this is just a PNG rotating in the middle of the screen, notice how choppy it is:
PImage v;
float t = 0;
float inc = 4;
void setup() {
v = loadImage("http://i.imgur.com/IMdHL.png"); // I googled this picture
size(1920, 1080);
imageMode(CENTER);
}
void draw() {
background(255);
pushMatrix();
translate(width/2, height/2);
rotate(radians(t));
image(v, 0, 0);
popMatrix();
t += inc;
}
I noticed two things:
1. If I set the sketch size to, let's say, 800x800, it runs much more smoother (even if I let the image's size be 700x700).
2. If I resize the image to half it's size (with the sketch size 1920x1080) it also runs much smoother.
The only thing I know now is that both sketch size and image size effect the choppiness of the program, but I just can't touch those parameters, the size of the sketch has to be 1920x1080, and the image size has to be about 700x700.
Do you have any solutions to that problem?
If not, how hard is to construct a simple windmill in Processing using curves/bezier/... (I've never used them in Processing)?
I can't stand this any more. About one minute after I click on the Processing icon I get this little window saying "Launch4j error, application won't start..bla bla". After I click "OK", Processing finally starts after about 10 minutes. What's up with that?? I googled it, but I found nothing useful.
So, I'd like to know if it's possible to access different frames of a video at the same time. For example, how would you make a program which would show a video whose left side is normal and it's right side is 2 seconds delayed. When I just think about it, it seems easy, I would just have to be able to access pixels of a video at different times, but I don't know how to do something like that in Processing.
what I'm trying to achieve is to make a noise sequnce whose start and begging match and by that I don't only mean that it's starting and ending point have to be the same, but also the noise flow has to be intact.
To achieve the picture above, I wrote this:
void setup() {
size(700, 700);
background(255);
stroke(0);
smooth();
noLoop();
}
float i;
float pom;
int num=100;
void draw() {
for (i=0; i<360; i=i+360/num) {
translate(width/2, height/2);
rotate(radians(i));
pom = 90*noise(i*0.01);
line(40 + pom, 0, 240, 0);
resetMatrix();
}
}
When I drew them, I changed their starting point to achieve these irregular shape in the middle, but the problem is clearly the "hiccup" on the right which I don't know how to remove. I should maybe change my approach to calculating the noise (perhaps combining noise function with some periodical functions like sin and cos), but I'm not exactly sure where to begin and I'm sure some of you have some good ideas for solving this problem.
By the way, some 3D programs (like Cinema 4D) include noise as an effector in many areas (like displacement, texturing..) and there is always a loop option so it is clearly programmable, wouldn't you say?
In short, what I am looking for is a way of giving two images (image_1, image_2) to a program which would then output coordinates of a little window (who's dimensions are equal to image_2's dimensions) in the image_1 that is the most similar to image_2 if you know what I mean. Basically, I'm looking for a window in one image that is the most similar to a template image.
I've found a little piece of software called ImageJ and I had to add a plugin and some .jars to it (javacv.jar is one of them). It does exactly what I want, but since I want to repeat this processing on multiple template images (and one original image), it turns out to be a bit impractical because I have to load each template image separately and run the template matching plugin and it would take forever to get all the coordinates I want.
I would like to do this in Processing and I'd really like to get as much information about this matter as possible from you guys. I have javacvPro which I think may be usefull, but that's all I know.
I'm working on something which would give results much faster if I could include automatic intersection detection. In short, what I want is to make a function which would recieve an image as an argument and would return (x, y) location(s) of the intersections. To make it a bit simpler, this image would consist only of lines and black&white pixels. The way of storing the coordinates data is not relevant, I'm just looking for a way of getting the yes/no answer if a pixels is an intersection or not.
Here's an example of a typical image that I would use:
What I'm asking you is to give me an advice, is there a good library which would do that for me or should I write this from scratch?
If the answer is the latter, I'd like you to give me an idea or suggest me a way of thinking when approaching a problem like this, if you know what I mean.
Hello, today I got an idea which could look cool if I use lines with different thickness along them.
Here's a function I wrote, it serves me well, but it's not perfect so feel free to edit it or suggest your own sollution to this problem.
It requires starting point, ending point and starting and ending radius'.
Ok, here's the thing. I'm working on developing an application for Android which is NOT entirely based on Processing. I'm following
these tutorials and I've got to the part where a simple menu is made. First option in a menu is some simple adding/substracting of numbers, second is a some kind of text transformer, simple stuff, but I tried to go a step further and added a third option in a menu which leads to a Processing application. In short, I managed to add a Processing based app to a "normal" Android app using only eclipse (it has nothing to do with the android mode of Processing).
Everything is working fine for now, but I'd like to know more about adding/saving pictures. I know that, if I want to load an image, I have to put it in /assets folder and it works just fine, but I'd really like to know how to load an image from the phone's gallery and then save it to the same place. I really tried to find a solution online, but I really did not find anything that I can use so I'm asking for your help.
This way, I see the result at the very end of the recursion if you know what I mean, there's no animation, only one result.
I understand that this is so because draw() function calls the drrr() function which calls itself, which then calls itself etc. and only when the recursion is over, the draw function finaly makes a loop and updates itself and draws the picture.
I'm looking for a way of drawing the steps of the recursion separately, each level of branches in a different frame and I have no idea how to even start programing something like that.
The reason I'm asking you how to do this is because I'd like to draw something like the lines in the first of two codes I posted above in order to simulate the growth
of mycelium. My idea is to draw a line which will then (at the moment I will define as I want) split into few branches which would then act in the same way as other branches and this deffinitely has something to do with recursion and I'd like to learn more about thinking in that way.
OK, so I have a Processing sketch which uses Minim library and I'd like to put that sketch on my tumblr (I know how to put sketches online, that's not the issue), but I don't know how to or if it is even possible to add a library to it when it is online so I'm asking you guys if there is a way..
Hello everyone!
I have a tumblr and a cool thing about it is that it's possbile to add a page to it. For example, if the url of tumblr is "http://processing.tumblr.com", additional page could be "http://processing.tubmlr.com/page1" and it can have a completely different source code. I wanted to have such a page that will consist completely of a processing sketch and the source code looks like this:
It's a simple program that draws a spiral, I know it's quite ugly but that's not important. The thing that bugs me is the line
size(screen.width - 20, screen.height - 192);. It sets the sketch size to a screen size substracted by 20 and 192 pixels and I chose those numbers because firefox adds a little border horizontaly and I had to substract so much verticaly because there is a browser menu on the top and windows toolbar on the bottom.
What I want is that the sketch size is set exactly to the browser window size automatically so that my sketch can use the "full potential" of a browser.
I hope I was clear about the thing I want and if the answer consists of javascript coding pleeease be specific about it because I really don't know javascript that much. I found some solutions that include javascript but I'm really nowhere near understanding it..
Hello everybody! I apologise for my bad English in advance..
So here's the problem, I'm using proHTML library for fetching some html data from a certain page, but this page requires logging in. I can login manualy, but it doesn't solve the problem, the code I have just stops at a login page.
For example, this code below doesn't do anything special, I used it just to simply demonstrate my problem, so, it should print contets of a "a" element and "html" attribute from this url "http://www.fer2.net/misc.php?do=whoposted&t=51670", but from results I can see that it just got to the login page.
import prohtml.*;
HtmlElementFinder htmlElementFinder;
void setup(){
//enter your url here
htmlElementFinder = new HtmlElementFinder("http://www.fer2.net/misc.php?do=whoposted&t=51670","a");