I am trying to create a grid of circles that resizes to fit the set space I have. It's a layout issue and I have tried different approaches like circle packing or recursion. But i think it should be a lot simpler than this? Also I've tried using for loops and have looked at others code but nothing seems quite right.
Here's a rough written algorithm of what I'm trying to achieve:
I have 1 circle to fill the space.
Make it's width and height fill the space.
I have 2 circles to fill the space.
Use a 2x2 layout grid of circles
Therefore divide circle by 2
Put 2 circles in the top 2 spaces in the grid - filling up from top left to bottom right
I have 3 circles to fill the space.
Use a 2x2 layout grid of circles
Therefore divide circle by 2
Put 3 circles in the top 3 spaces in the grid - filling up from top left to bottom right
I have 4 circles to fill the space.
Use a 2x2 layout grid of circles
Therefore divide circle by 2
Put 4 circles in the top 4 spaces in the grid - filling up from top left to bottom right
I have 5 circles to fill the space.
Use a 3x3 layout grid of circles
Therefore divide circle by 3
Put 5 circles in the top 5 spaces in the grid - filling up from top left to bottom right
Etc etc.
Here is where I have got to using someone else's code as a starting point:
Change the 2D array numbers at the top to 3 and 3 or 5 and 5 etc to create a grid that fits the space.
However, my issue is this system only goes up in jumps from 1 to 4 to 9 to 25 etc.
What happens when I want 3 circles in the grid.
What I would ideally want is for the the grid to be laid out like this:
1 circle fills whole space
2 circles is within the 2 by 2 grid and only takes up 2 of the total 4 circles.
This would keep filling up until 5 circles when the grid would change to the 3 by 3 grid.
Etc
It's starting to blow my mind a bit which is sad :(
If anyone needs further explanation or maybe a diagram then please let me know!
I am looking for a coder to work on a sound reactive project for a band's live visuals. I have started the work, but unfortunately have no time to continue them with other work that I have on. I have sketches and can provide a brief. But these need to be taken further, explored more and finished.
I gather from reading as much about it as possible that what people do is create objects to replace the inherent shapes in the library with other objects and colour those? How do you do this?
I have got the most pixels server running locally on my computer.
However, the void frameEvent(TCPClient c) function does not seem to run (and hence there is nothing visibly happening in the sketch - as when using the mostpixelsever library this function replaces the draw function).
I have tried using println's to debug it and it seems that the draw function is running. However, the frameEvent function is not.
Does anybody have any idea what is going on?
I have searched hard for an answer on the forums but it seems that there was something two years back that didn't get a response.
Thank you so much in advance and my apologies for my multiple posts over the last day.
I am making an installation in which I am projecting around a room using mostpixelsever and I want to switch between processing sketches upon certain triggers (whatever these might be). I would also like to switch between video (probably HD) and create some kind of responsive video in which multiple videos are loaded in buffers and sound reactivity causes a jump between videos (probably using GSvideo).
I wondered what system people would recommend using. For example I know that Open Frameworks would probably be more efficient, but I am having trouble with OF and struggling to learn C++.
Firstly, is it possible to switch between processing sketches?
Secondly, what is the best way to trigger switches between multiple videos using GSvideo (as I have checked the forums and this has been asked but seemingly not answered)?
If anybody has any suggestions then please let me know.
I have tried googling this in all sorts of combinations of search terms but all I got was the possibility that I am not referencing where the mpeServer.jar file is on my computer properly (using a Macbookpro).
The processing sketch told me I had to change my java to 1.6, so I did this.
But now there is a processing sketch error (I am assuming it's because of the terminal issue?):
Client: Settings: server = localhost:9002, id = 0, local dimensions = 200, 400, location = 0, 0
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:432)
at java.net.Socket.connect(Socket.java:525)
at java.net.Socket.connect(Socket.java:475)
at java.net.Socket.<init>(Socket.java:372)
at java.net.Socket.<init>(Socket.java:186)
at mpe.client.TCPClient.start(TCPClient.java:450)
at mpeTest.setup(mpeTest.java:56)
at processing.core.PApplet.handleDraw(PApplet.java:1383)
at processing.core.PApplet.run(PApplet.java:1311)
at java.lang.Thread.run(Thread.java:637)
Client: Running!
Client: Sending: S0
Exception in thread "Thread-2" java.lang.NullPointerException
at mpe.client.TCPClient.send(TCPClient.java:606)
at mpe.client.TCPClient.run(TCPClient.java:469)
I am just trying to run the example sketch that comes with the library.