Das Ergebnis soll weiterhin so aussehen: http://www.scrabble-blog.de/wp-content/ ... le2844.jpg" onclick="window.open(this.href);return false;
Code: Alles auswählen
glDisable(GL_TEXTURE_2D);
glDisable(GL_LIGHTING);
glDisable(GL_DEPTH_TEST);
glEnable(GL_CULL_FACE);
glEnable(GL_BLEND);
fb2:=FBoardSize/2;
for x:=0 to FBoardSize-1 do
for y:=0 to FBoardSize-1 do
for z:=0 to FBoardSize-1 do
begin
glPushMatrix;
//position
glTranslatef(x-fb2,y-fb2,z-fb2);
//color
if assigned(FOnGetFieldType) then
ConvertColor(FOnGetFieldType(x,FBoardSize-y-1,FBoardSize-z-1,a),r,g,b);
//add to list if letter or draw blended
if assigned(FOnGetFieldLetter) then
aLetter:=FOnGetFieldLetter(x,FBoardSize-y-1,FBoardSize-z-1);
if aLetter<>nil then
aList.Add(aLetter) else
begin
glColor4f(r,g,b,a*(FTransparency/MaxTransparency));
glCallList(Cube);
end;
glPopMatrix;
end;
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LEQUAL);
glEnable(GL_TEXTURE_2D);
glEnable(GL_LIGHTING);
glCullFace(GL_BACK);
for x:=0 to aList.Count-1 do
begin
glPushMatrix;
glTexImage2D(GL_TEXTURE_2D,0,GL_RGB,TextureSize,TextureSize,0,GL_RGB,GL_UNSIGNED_BYTE,GetTexture(TLetter(aList.Items[x])));
glPopMatrix;
end;
Code: Alles auswählen
Cube:=glGenLists(1);
glNewList(Cube, GL_COMPILE);
glBegin(GL_QUADS);
{Front Face}
glNormal3f( 0.0, 0.0, 1.0);
glTexCoord2f( 1.0, 0.0);glVertex3f( 0.5, 0.5, 0.5);
...