I know the EclipseP5Exporter has technically been replaced, but according to the wiki, its replacement doesn't do exports yet, so I still need it.
Why does the exporter package so many .jar files into it's output? Neither the in-app Processing exporter, or the default mac app exporter in eclipse do that.
My guess is that they're there in case Java isn't installed on the target machine.
Can I remove these from the lib folder for the exported exe without messing something up? 'These' being everything except core.jar and <myAppName>.jar .
In my project I need to detect the dominant frequency going into a mic (I'm using a yamaha keyboard or whistling to test it).
My current implementation essentially copies the FFT minim example, and looks for the band with the highest strength. If I'm using a pure wave of some kind it works fine, but on some instruments settings, the signal indicator jumps between the correct one and a much higher one.
Now I'm
assuming this comes from harmonics in the instrument, and not a more general noise issue (though I do need to look at that further). So my question is whether there is a mathematical/programmatic way to remove harmonics from a signal.
In my simulation, I'm using randomSeed to keep the random actions consistent if I wish, so I can have it rerun multiple times while slowly changing one behavior variable.
That solved the problem for the moment, but since I've implemented threads (so it doesn't freeze momentarily while the pathfinding executes), each iteration has become slightly different again (I'm not changing any behavior variables yet).
Without getting into the specifics of my code, has this kind of thing been a problem before? Ensuring that the different random() calls get called in the right order?
Just out of curiosity, is there any difference speed/memory wise between something like:
for (int i=0; i<entities.size(); i++) {
Entity e=entities.get(i);
e.doStuff(); etc;
}
and
Entity e;
for (int i=0; i<entities.size(); i++) { e=entities.get(i);
e.doStuff();
}
It seems like there would be
something, as the second one doesn't have to allocate(?) the space for "Entity e" each time?
Also probably it wouldn't create any noticeable difference to the user, so this question is mostly just theoretical.
So I know this has been asked before around, but I feel this time has some different factors.
Running the program (as a java application, not an applet) from eclipse works fine. Exporting it as a Mac application works fine, on my computer. It's only when I try and run the exported program on another computer that I get the "no jogl in java.library.path" message.
I have all my .jnilib files in a folder in my project. I went under buildPath->libraries for the project properties and set the native library location for jogl and glugen. I've tried using -Djava.library.path both in the projects default VM arguments, and in the VM arguments set at export.
Now obviously this isn't an immediate problem keeping me from working on it, but it will need to be fixed by the time I'm passing it to other people for testing.
Any thoughts?
Edit: as a side note, while I have the .jnilibs in a folder, my .jars are just sitting in the main directory, next to src, bin, data, etc. Does that matter?
Edit2: Just moved them into their own lib/ folder, evidently it does not affect anything. :P
I was wondering, about how many textured polygons should I be able to render per frame, using PGraphicsOpenGL, where the sketch will still run around the default 60 fps?
I'm doing this in Eclipse, using the JOGL calls (gl.glVertex3f() etc. ) rather than built in p5 ones, and I feel like I'm losing framerate at a much faster rate than I should be.
In addition, to see if I need to change how I do things in future projects:
Is JOGL significantly slower than 'normal' OpenGL? (i.e. doing it through C).
Is the way PGraphicsOpenGL uses JOGL significantly slower than just doing an implementation in straight Java? (I'd hate to have to give up all the p5 niceties. :P ).
Finally, I've seen VBO's mentioned around on the forums, would using those provide a significant speed increase?
In my program, once per frame I look at what's underneath the mouse pointer and change the cursor image as appropriate from an array of PImages.
Right now, theres a problem where the pointer 'flickers' between what I want and the regular cursor, in a space of about 50 pixels, for about 1 second, then goes away. The flickering seems to start after clicking or right clicking, but not always.
I'm using Processing through eclipse, and using the OpenGL renderer.
Anyone experience something like this before?
Edit: ugh, this was supposed to go in core library, sorry.
for (int i=0; i<e.length; i++) marked[i]=(e[i].update());
Entity[] newEnt=new Entity[0];
for (int i=0; i<e.length; i++) if (marked[i]) newEnt=(Entity[]) p.append(newEnt,e[i]);
return(newEnt);
}
The point of this is that I can pass in my arrays of enemies, projectiles, etc that are currently in the gamestate, and it will update them and remove the dead ones from the list (the individual update functions return booleans as to whether the entity is still alive).
This function works until I try to use it's result (line 1), which give me a ClassCastException. If this is always the case, how does the append function get around this?
Another possibility: would there be a way to pass in the name of the Class I want as an argument, and create the newEnt array based on that in line 6?
boolean checkClass(Class c) {
return(obj instanceof c);
}
Where obj is an instance of an abstract class with several extending classes.
Both Processing and Eclipse with Processing disallow this, saying something about not recognizing c.
So I'm making an RPG game using single images on polygons for the graphics (think Doom with no animation ;) ). The graphic images I'm using are 32*32 pixels each arranged in large grids. My main problem right now is that at that size, they become too blurry when rendered to polygons 400 pixels high. For this reason I'm scaling up their size when I load them. 2X is not enough, but when I try scaling 3X I get an out of memory error, and garbage collection every Nth time doesn't help. This is odd since all of the images only come out to 724 kilobytes (so shouldn't that only be about 6mb when scaled?) So my first question:
Is there a way to increase resolution of a polygon without having to just increase the size of the image?
Currently, I'm working on a level editor for it, which is why I need all the images loaded at once. In the game itself I'll have a more intelligent way to only load the images I need for that level.
Another thing I'm not sure of is how to store them. Right now I'm splitting them all up into an array holding each 32*32 (or now 64*64 or 96*96) tile. So my second question:
Would it be helpful or harmful to just store them in their unscaled grid form, and then each time I texture a polygon, get() the part I need and scale it, then replace it with the next one? I'm just not sure how expensive get() and suchlike are.
While working I realized the Radio controllers I was working with were outdated, and moved to RadioButtons. This mostly worked, except for the lack of an equivalent for the changeValue() function (which set a controller without broadcasting the change). activate() obviously doesn't cut it, for the reason mentioned.
Any ideas?
Edit: Doh. Can't believe I forgot to mention that. It's ControlP5. :P