But I didn't find a way to get one single path instead of a tube. A path I could read out and give into camera. Any ideas?
FInally I thought of making a class CameraData and store the 6 camera positions and then make an ArrayList of it and store the points into it the camera has to fly to. But I realized it would look uncool because with fixed points, the camera would fly with rough angles.
So my questions are:
If I stick to the idea of class CameraData, how would I smooth out the movement? Or use damping here?
I wondered if there's a local menu in processing that I can program using controlP5. You know, when I right click with the mouse e.g. on an rect a menu that says "change color", "change size" etc. Much simpler than in the image below of course.
I am still thinking about a marble machine with tracks for marbles.
With a marble rolling down in 3D construct.
There is a system made of wood that I would like to program in processing: http://www.cuboro.ch/de/Info/Produkte (there seems to be an elevator system for the marbles they are proud of)
There are wooden blocks with tracks upon it, but also blocks with tunnels in it, even blocks with 90° curves in or upon it.
When I program it, I want to run a marble through it, not as a proper physics engine but as data structure that knows, where is the cube and where is/are its entry point(s) and exit point(s), so the marble can pretend to follow the right path and fall where it should etc.
I am not sure how to make a class for it.
I could have an ArrayList of all cubes and its pos, its type and its rotation.
There are I think 9 basic types like
straight tunnel with straight track upon it (both same direction)
straight tunnel with straight track upon it (90° to each other)
straight tunnel with curve to the left upon it,
straight tunnel with curve to the right upon it,
crossing of two tracks upon it (+) and tunnel leading in on the side, coming out of the button ( \ )
How can I make my class so, that the rolling marble comes into the block, knows its new direction and in which cubes it goes next and from which of its sides? This must be some kind of a rule set.
How can I make connections between two tracks / cubes?
Later the marble machine could be shown visually 3D with the rolling marble, camera follwoing it, marble making noises when rolling or falling. Later still there could be a visual editor to make and save your own marble machines.
Thanks for any thoughts on that data structure thing!
I have performance issues within a for-loop that lies in a recursion.
Can I just ask some questions?
I learned while searching for "performance" in the forum the compiler is pretty bright and makes good decisions. Obviously, I declare everything outside loop and recursion to save it time.
1st question: Does the data type make a difference in terms of speed?
int // for x (or float)
int // for y
int // for z
2nd question: Does the usage of Strings and + need a lot of time?
I heard usage of + with String is not recommended - what does the merging with StringBuilder look like?
3rd question: Allocated memory?
When I make the memory usage higher in my IDE and compile, does the exe-file (the application) under Win 64 knows the higher memory usage? Or how can I enforce it? (or doesn't it matter since Win 7 provides memory dynamically?)
I don't understand PVector.angleBetween or it doesn't give the results I expect.
I thought it would work like in a circle: you hand it the middle of the circle as PVector and another point on the circumference as PVector and you got the angle (the same thing that with cos and sin would give the difference of x and y).
But I don't think it does....
So what does it really do... and what can I do to achieve what I want?
I post my Code to clarify. I know it gives you rad and I convert it to degrees but still...