glScale and reflections

hi there,

im currently putting reflections into my
game engine but am having problems with
the call to glScale in that it doesnt do
anything

I thought that if i rendered a primitive
then called glScale(1,-1,1) and re-rendered
the primitive it would be flipped around
the y plane however i only ever get the one
primitive rendered.

im only using glScale for testing purposes as i intend to have reflective surfaces in
any plane and will therefore transform my
vertices by a matrix before the second pass
however it is a bit strange.

Any ideas??

Thanks

Mark

give some more code pls

hi there,

this is not the exact code for rendering
as i have removed the code for stenciling
while sorting out this problem

//*****************************************

//Render all opaque primitives ( This works )
Engine.Materials.Render(False);

//render reflections
glPushMatrix;
glScale(1,-1,1);

//re render opaque reflected primitives
Engine.Materials.Render(False);
//render alpha blended reflected primitives
Engine.Materials.Render(True);

glPopMatrix;

//render alpha blended reflected primitive correctly
Engine.Materials.Render(True);

//*****************************************
Mark

When you do reflections this way, you will have to reverse the backface-frontface culling, because scaling it like this will reverse the facing on all of the polygons.

Thanks for all the help

Ive found the problem

if Assigned(glDrawArrays) then
begin
glColorPointer(4,GL_FLOAT,0,FColors);
glTexCoordPointer(2,GL_FLOAT,0,FTexCoords);
glVertexPointer(3,GL_FLOAT,0,FVertices);
glDrawArrays(GL_QUADS,0,FQuadCount * 4);
end else begin
glBegin(GL_QUADS);
for I := 0 to (FQuadCount*4)-1 do
begin
glColor4fv(@FColors[i]);
glTexCoord2fv(@FTexCoords[i]);
glVertex3fv(@FVertices[i]);
end;
glEnd;
end;

//this is it!!
FQuadCount := 0;

I was setting quadcount = 0 so in the
next pass it was rendering nothing!!

Hey ho. Some sleep might help!

Mark