Hi, people! I wonder if someone can give me some insight in this:
I am programming a network visualizing sketch, with some elastic and inverse square forces between nodes. I am using verlet integration for the physics. I had a generic class for physical objects, lets call it PhysObj, and I extended it with a class called VerletObject (verlet objects have a different integration method and an additional variable for position), but also, i extended a PhysObj with a class called Node. The Node class is needed because each node in the network has a name, and some other attributes. So, my question is, can an PhysObj be at the same time a Node and a VerletObject?
I guess if I want to do that i should rather extend a VerletObject with a Node class (or the opposite), but that doesn't seem a clean choice. Perhaps my mistake is conceptual, and I should not try to make a Node a PhysObj, because a node is not a physical object. Then, i could work with an ArrayList of VerletObjects, which co-exists with an ArrayList of Nodes.
Hi, i get an error when trying to override a function in an extended class, i wonder if someone can help me with this. Basically, what i want to do is to override a function but calling it with different arguments:
void setup() {
Thing thing = new anotherThing();
thing.function(); // this works, but calls the function in the main class.
//thing.function(new PVector()); // this doesn't work
}
class Thing {
Thing() {
//some code
}
void function() {
// This function has no arguments
println("this is Thing's function, with no arguments");
}
}
class anotherThing extends Thing {
anotherThing() {
super();
//some extra code
}
void function(PVector aVector) {
println("this is AnotherThing's function, called with an argument " + aVector);
I've been trying for a while to get my PSEye working with processing. I managed to get it working using
macam, an OSX driver for hundreds of cameras. I dont know if this is the best solution but it might be cool since you will have support for many other cameras. I post it here in case it is useful for anyone.
I used this code to see if the cam was available:
and got errors in all but devices [2] and [3] ([3] is the built-in iSight). I suspect that if [2] is not available, then processing tries [3], but i'm not sure about that.
As the PSEye did not appear, I dowloaded macam. When extracted, you get the application, the source and a component. To get the stuff working, I copied the macam.component file into /Library/Quicktime/ and restarted processing.
Then, when I run the first code above, I got this output:
[0] "Google Camera Adapter 0" [1] "Google Camera Adapter 1" [2] "IIDC FireWire Video" [3] "Sony HD Eye for PS3 (SLEH 00201) #459" [4] "USB Video Class Video" [5] "Vídeo DV"
which means the PSEye is now recognized! To make it work, I just replaced the name of the PSEye in the constructor:
myVideo = new Capture(this, 320, 240, "Sony HD Eye for PS3 (SLEH 00201) #459", 20);
or this, if its the third device:
myVideo = new Capture(this, 320 , 240 , devices[3], 20);
I suspect that since I installed macam, I get this warning when using Capture Objects:
2011-10-30 23:19:14.333 java[2537:11803] *** __NSAutoreleaseNoPool(): Object 0x111ae70 of class NSCFString autoreleased with no pool in place - just leaking
I copied it in the /processing/Contents/Resources/Java/libraries folder with no succes. Thats where all other libraries are located. I'm using MAC OS 10.6.3