illusia - 2011-12-30

hi everyone,

im programming with openGL and i have a problem with initialising an array of
objects, somehow they seem all to change, if i change one. i have a Tree
class, so it looks like this:

Tree *treeArray;
treeArray = new Tree;

then to initialise the position:
treeArray.init(x1, y1, z1);
treeArray.init(x2, y2, z2);

and now a function to draw them:

and now the part i dont understand: this tree is painted at the position of
tree, to be precise in fact all the trees of that array are drawn on one spot,
and that are the coordinates of the last initialised tree. this must mean,
when i change one object of the array, all of them change. why is that?? is
something wrong with my code? ive tried also dynamic initialisation with the
"->" operator instead of "." as well as declaring global and local objects -
but it didnt help at all.

pleeeeaaase help!! -_-