Opengl Transformation

Would something like this work. I am drawring a model and then passing its matrix on. Later I might have to draw and effect. So I am passing the matrix of the model to the effect and then translating the effect within the models matrix.

I cannot make it work like this. So is it a brainfuck of mine or should just look for a bug.


GL11.PushMatrix();

Gl11.MultMatrix(matrix);

//draw the model

GL11.Popmatrix();

//alot of calls code
....
....
..
//an effect object is now called
GL11.PushMatrix();

Gl11.MultMatrix(matrix); //Same matrix as model matrix

Gl11.glTranslate(x,y,z); //translate to a position on the model and do some effect

//draw an effect

GL11.Popmatrix();







well forget it had forgot to center my geometry in my 3D moddelling app…