# HELP:3D chess board using Opengl????

hii...can someone plz help me design a 3D chess board using opengl for windows...i tried the net...got one but its too complex...i need it for my assignment....preferbly with comments...
thanks a million

• How difficult is it to draw 64 squares with white and black colors ?

: hii...can someone plz help me design a 3D chess board using opengl for windows...i tried the net...got one but its too complex...i need it for my assignment....preferbly with comments...
: thanks a million
:

• im a newbie to opengl so i donno much...plz help me if u can?

: How difficult is it to draw 64 squares with white and black colors ?
:
: : hii...can someone plz help me design a 3D chess board using opengl for windows...i tried the net...got one but its too complex...i need it for my assignment....preferbly with comments...
: : thanks a million
: :
:
:

• [b][red]This message was edited by CroW at 2003-6-23 12:23:53[/red][/b][hr]
hi,

i suppose you know,how to init opengl and the basics on rendering stuff.
the simplest way to create a chessboard is to draw a simple quad with a texture on it.the texture could easily calculated like this:

[CODE]
unsigned int pTex[32*32];

for(int x = 0;x < 32;x++)
for(int y = 0;y < 32;y++)
if( (x < 16) && (y < 16) || (x > 16) && (y > 16))
pTex[y*32+x] = 0xffffff;
else
pTex[y*32+x] = 0x000000;
[/CODE]

you have to repeat this texture 8 times on each axis over the quad by setting the tex-coords from (0.0f,0.0f) to (8.0f,8.0f)

to give the board a little more 3d-look you could use more quads for the bottom and sides of the board.

another way (without texturing) is to draw 8x8 quads with alternating colors.

• yo Crow,
thank man