PDA

View Full Version : Distance between tetris shape-cubes varies...



Helgi
07-15-2009, 08:30 AM
Hi
I am trying to get myself acquainted with opengl
and I decided to start with a tetris game, just to make something interesting...
What I stumbled over recently is..
when a shape falls down - the distance between cubes that it is composed of - varies.. so sometimes adjacent cubes look like their is no spacing between them.. and quite the reverse - the spacing is a bit larger

same effect is when I resize the window

I thought it could be related to antialiasing
but Im not sure and it seems to me its not that..

I experience same problems in both perspective and ortho view
So it's basically ortho view and camera is in the default position

points that I draw along the coordinate system axes
have same problems also

thanks for help in advance

Hlz
07-16-2009, 07:41 AM
I don't quite understand your question as posed. A screen grab of the problem would be helpful.

As I recall in Tetris you have to arrange falling blocks so that they fit neatly together in a brick wall of sorts. I'm guessing that the wall isn't neat enough or you are having difficulty with the gaps... ?

Helgi
07-16-2009, 09:17 AM
ok, sorry, i'll try again
and here's a screenshot
http://sites.google.com/site/vooimages/home/tetris_01.png?attredirects=0

and a video grab, so that you can see ALL !!!! :)
http://www.youtube.com/watch?v=J4jOb8pqy68

the shapes are not whole, they are composed of 3d cubes
and there is a fixed gap between them (defined in code)
a cube's side is 1.0f and gap is 0.05f;

but as I move a falling shape around, left\right, I can see that the gap is not the same all across the cup...

and when I resize my window, I can see that the cubes are kinda making tiny rushes back and forth, as if they cant decide the exact coordinate..

I dont' know how to explain it in more detail, the screen shots shows what is wrong

Hlz
07-16-2009, 10:33 AM
Right on, I get it now ;)

I'd be tempted to go to an all integer 2D/3D grid/lattice for this.

As you say it's going to be quite a pickle maintaining exact (pixel) distances with an arbitrary view in 3D. Anti-aliasing with a wider gap could help soften things up a bit.

Helgi
07-16-2009, 10:58 AM
simple things i'm trying to do
and the problems are already here :) rrrrrr

I hope antialiasing is going to fix it
thanks for your support