I have sorted the rotation issue. As suspected the problem was that rotations were being calculated in local space. I could probably have done a world space rotation function but it was just as easy just to check the draw matrix and determine which was to rotate branch. In the above image the tree is currently only being rotated around the z-axis. So I check the x co-ordinate system of the y axis to the x co-ordinate of the x axis. All I need to determine is whether they are positive or negative in order to know what rotation to apply on the z-axis.
The other tiny feature added is that the angle of rotation is now based on the difference in light between the two directions. This creates the effect as seen in Figure 1 where the tree bends more towards the light if it is growing in a deeper shade area.
The other tiny feature added is that the angle of rotation is now based on the difference in light between the two directions. This creates the effect as seen in Figure 1 where the tree bends more towards the light if it is growing in a deeper shade area.