I've just begun messing around with get(), and it seems like it's adding every get() instance in the memory till it reaches the memory limit...is it possible?
in task manager I can see it growing in memory.. here's my code..
PImage a;
void setup(){
size(500,500,P2D);
a=loadImage("blast.jpg");
imageMode(CENTER);
}
float x=0;
void draw(){
background(0x1d1d35);
pushMatrix();
translate(250,250);
rotate(radians(x+=0.9f));
image(a,0,0,500,500);
tint(255,0,0);
popMatrix();
a=get();
}
Is there a way to flush that memory?
I've tried with a simplest get() possible and it worked fine..it seems it's getting the pixels that eat up all the memory.. but the picture is small.. and 1 image in memory shouldn't be a problem... I might be missing something..
Hi I'm new to processing and I got this problem.. is there a way for getting a result that one could expect from such a code?
image(a,0,0)
pushMatrix();
rotate(x);
blend(b,0,0,.....);
popMatrix();
I tought pushMatrix() would trick blend() to change it's coordinate to the position defined in rotate() but it seems that rotate has no effect on blend()..
Hi, I'm experimenting with PNGs with transparency and was wondering... is it possible that a png image can't be drawn properly "behind" another png image when it is located in the right half of the screen?
Is it a known bug.?.. I created a sketch that run fine in the PDE but as soon as I export it as an applet... google chrome won't even load anything but IE & Firefox give me the Error : class not found : sketchname.
this won't work..
import processing.opengl.*;
void setup(){
size(500,500,OPENGL);
rectMode(CENTER);
}
void draw(){
rect(250,250,300,300);
}
yet this will work
void setup(){
size(500,500);
rectMode(CENTER);
}
void draw(){
rect(250,250,300,300);
}
I've found posts that date back to october 2010 with no solid answer.. Any news about this?
I've been trying to implement a first person perspective using the mouse to rotate the camera and WASD to move around using the pushMatrix function but I'm stuck at this point. It's probably poorly programmed but I'm waiting for a positive result before optimisation..
void setup() {
size(640, 360, P3D);
background(0);
}
int space=70;
int hormove=0;
float fev=0;
float xpos=-500;
float zpos=0;
void draw() {
lights();
background(0);
pushMatrix();
if(keyPressed) {
if (key == 's' || key == 'S') {
xpos-=4;
}
if (key == 'a' || key == 'A') {
zpos+=4;
}
if (key == 'w' || key == 'W') {
xpos+=4;
}
if (key == 'D' || key == 'd') {
zpos-=4;
} }
if(mouseX<(width/2)-200) {
hormove-=1;
}
if(mouseX>(width/2)+200) {
hormove+=1;
}
translate(zpos,0,xpos);
rotateY(radians(hormove));
for(float x=0;x<width;x+=space) {
for(float z=0;z<(200);z+=space) {
for(float y=0;y<height+1;y+=height) {
pushMatrix();
translate(x,y,z);
noStroke();
fill(255);
box(space);
popMatrix();
}}}
popMatrix();
println(xpos);
}
Any info on how to proceed would be greatly appreciated.
I've been using processing for about 2 weeks so i'm quite new to it. I've created a "for" loop that fills the background with 20x20 squares. Now i want to add white squares on top of it all to write words with the pixels.. I've got a list of all the Xs and Ys I want my 20X20 squares to be placed..
..that's what I've been doing but I'm pretty sure there's a more affective way..
int x=20;
int y=20;
void draw(){
fill(random(230,255));
rect(3*x,2*y,20,20);
rect(4*x,2*y,20,20);
rect(8*x,2*y,20,20);
rect(9*x,2*y,20,20);
rect(12*x,2*y,20,20);
rect(13*x,2*y,20,20);
rect(14*x,2*y,20,20);
rect(17*x,2*y,20,20);
rect(18*x,2*y,20,20);
rect(21*x,2*y,20,20);
rect(25*x,2*y,20,20);
I am wondering if there is a way to use a list of coordinates (x,y,x,y,x,y....) (3,2,4,2,8,2,9,2) to generate all the squares i want..