So, there is the Probability Density Function (PDF) (or
Gaussian function or Bell Curve) for some programming examples. The formula is: [a * e^( ( -( x - b )^2 ) / ( 2 * c^2 ) )], but you can use the link to see it written better.
I have used this function in a Processing programming example, where there is a plane in the 3d space, and various functions are applied to it, additively, producing various morphs. The gaussian function produces Hills...
There are, though, some other examples I have in mind, for which I need to use the
Cumulative Distribution Function (CDF). CDF is related to PDF, and more precisely, CDF is the integral of PDF. So if i have an entity that grows over time and PDF represents its growth over time, then CDF will represent its size over time.
Suppose, for example, that the growth of a tree (or a branch) starts slowly, then maximizes, and then slows down again. This is a phenomenon that can be described (or modelled over time) by the Gaussian Function. The length of the branch, though, can be calculated over time by the Integral of this function, which is the Cumulative Distribution Function.
Well, I am having some trouble in finding a way to programmatically describe the Cumulative Distribution Function, because I cannot find a formula for it that can be expressed within the boundaries of Processing. (It can be done very simply in Matlab)
Hello all, I have been working for some time on developing some code to produce 3d trees. Whoever wants to take a look at the post, it's
here. There is a sub-problem of the tree problem which made me start this new post.
Problem description:
We have a local coordinate system, defined by a point in the world Coordinate System (the local zero point).
Then we apply some rotations to the local coordinate system.
Then we make another local coordinate system, which is dependent to the first one (the first local c.s., not the world c.s.) and we apply new rotations to it.
Then there is another local, dependent on the previous one, and so on.
I have been using openGL commands to handle the local coordinate systems, like the translate command. And I can store the world coordinates of a local point by using modelX(), modelY() and modelZ(). Then pushmatrix() takes us back to the world coordinate system. But I am having trouble in passing the local rotations the right way.
The problem could also be rephrased/approached as follows:
how to match a coordinate system's axis to a random 3d vector.
Any thoughts on the matter would be greatly appreciated.
* I did not post a code example here yet, but the latest (at the time) post of 3dtree includes this problem.
Hi all, I am planning to make a 3d tree generator and growth - simulator in processing.
Here is a description of what i want to do:
-The programme starts, one branch starts to grow (1st generation)
-when it reaches a certain length a node is formed, then some new branches appear (2nd generation)
-the first branch continues to grow, but the growth slows down over time
-when the 2nd gen branches reach a certain length, then the 3rd gen appears, and so on...
-there is a flow of energy coming from the first branch and splitting to the following ones.
-there is a rule as to how the energy is divided to branches
-could be: "more vertical = more energy = more growth"
-And then the tree forms and grows, and the cpu is on fire...
At the moment I don't care about the graphics so much, which means I will probably use some 3d lines to form the trunk and branches.
Thoughts i have in mind for the matter are:
-I would like to keep every branch as a separate object (class) with its own properties and parameters. Each branch has a parent branch, from which it takes energy. Also its position is relative to its parent-branch's end point and direction.
-For sure there are some vector - based stuff i have to work with, but i think the crucial point is usage of classes.
* This will differ from a fractal - based tree generator in the fact that the tree grows dynamically, and is not static.
** I should be back with some code to discuss on soon.