glClearColor(0.0f, 0.0f, 1.0f, 1.0f);
glShadeModel(GL_SMOOTH);
glClearDepth(1.0f); // Depth Buffer Setup
glEnable(GL_DEPTH_TEST); // Enables Depth Testing
glDepthFunc(GL_LEQUAL); // The Type Of Depth Testing To Do
//glFrontFace(GL_CW);
glEnable(GL_CULL_FACE); // Enable Back Face Culling;
Any suggestions please?
-thank you-
-PK-
[DESIGN] Best Method to show a *chessboard* grid?
Hi all.
I''m trying to impliment something like a chess board.
I''ve got two display lists, that are 3D boxes, one white, one black.
I was doing a simple 2D loop, incrementing the position with each iteration before *calling* the display list.
It works.
But i''m getting 2 or 3 fps =(
Is there a better way to do this?
Also, as far as i know, i think the only *efficient coding* is this..
-PK-
You just want a checker board pattern? If so, make a texture of a checkerboard, then map it to a quad. Simple & fast.
There are many other ways to do what you want.![](smile.gif)
There are many other ways to do what you want.
![](smile.gif)
um. i actually can't do it that way. (use a texture)
My game is not really a chess board - i used that as an example. Looks like it's a bad example.
the *board* is actually a grid. Each *sqaure* is .. lets say .. each square could be a random colour.
** SO it's like a massive chessboard, with each square being a random colour **
that is why i'm making cubes.
-PK-
Edited by - Pure Krome on February 2, 2001 1:07:09 AM
My game is not really a chess board - i used that as an example. Looks like it's a bad example.
the *board* is actually a grid. Each *sqaure* is .. lets say .. each square could be a random colour.
** SO it's like a massive chessboard, with each square being a random colour **
that is why i'm making cubes.
-PK-
Edited by - Pure Krome on February 2, 2001 1:07:09 AM
-PK-
Well, you can still use textures.
Anyway, do you really need a cube? (6 sides) or do you just need 1 face?
You could just go into a loop, and create 1 face (using whatever color),next face, change color...and so on. So you end up with say 64x64 grid of say 8x8 squares. In this case, you would end up with 64*8*2 polys though.
That is for 1 face each. Mult another 6 for cubes, so you end up with 6000+ polys...
So what was the question--I mean you ask is this an efficent way, but you don''t show the code, you show the init phase...
![](smile.gif)
You could just go into a loop, and create 1 face (using whatever color),next face, change color...and so on. So you end up with say 64x64 grid of say 8x8 squares. In this case, you would end up with 64*8*2 polys though.
![](smile.gif)
So what was the question--I mean you ask is this an efficent way, but you don''t show the code, you show the init phase...
Ok. I''ve included some (very poor) code to explain what i''m doing.
In my int main(void) function....
now this is my *edited* version of RenderScene function
I''m trying to show a map, which is an ascii file.
Later on, i wish to change the sqaure face tiles into something different, like triangles to represent hills or mountains, etc.
I''m using an ascii map, becuase the game is TEXT BASED (A MUD, using telnet client, etc...), and certain parts of the map are shown during the game.
Please help folks.
-PK-
In my int main(void) function....
|
now this is my *edited* version of RenderScene function
|
I''m trying to show a map, which is an ascii file.
Later on, i wish to change the sqaure face tiles into something different, like triangles to represent hills or mountains, etc.
I''m using an ascii map, becuase the game is TEXT BASED (A MUD, using telnet client, etc...), and certain parts of the map are shown during the game.
Please help folks.
-PK-
-PK-
A/ r u drawing stuff that doesnt appear on the screen?
B/ calling display list for very simple objects eg a quad will slow the program down.
C/ this could be slow "renderBitmapString"
http://members.xoom.com/myBollux
B/ calling display list for very simple objects eg a quad will slow the program down.
C/ this could be slow "renderBitmapString"
http://members.xoom.com/myBollux
>>A/ r u drawing stuff that doesnt appear on the screen?
yes i am. Most of the sides of the boxes are touching each other, which means they are hidden. This is a massive waste,of course. I do not know how to *hide those*.
B/ calling display list for very simple objects eg a quad will slow the program down.
hmm .. ok ....
C/ this could be slow "renderBitmapString"
hmm .. ok ..
I think my biggest problem is how do i hide all the sides of the squares that are *hidden*.
Do i need to place my grid of sqaures into some TREE structure, which knows how to hide any *hidden* faces?
-PK-
yes i am. Most of the sides of the boxes are touching each other, which means they are hidden. This is a massive waste,of course. I do not know how to *hide those*.
B/ calling display list for very simple objects eg a quad will slow the program down.
hmm .. ok ....
C/ this could be slow "renderBitmapString"
hmm .. ok ..
I think my biggest problem is how do i hide all the sides of the squares that are *hidden*.
Do i need to place my grid of sqaures into some TREE structure, which knows how to hide any *hidden* faces?
-PK-
-PK-
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement