PDA

View Full Version : graphic problems



sacredPenguin
08-29-2004, 01:01 AM
hi all,

i'm programming a voxel game and my problem is that i have to put a lot of cubes and if i do this there are some graphic errors. you can see lines between the cubes. here is a screenshot: http://www.stonedfrogs.ch/images/misc/jpg/roulade.jpg

please help me

greetz sacredPenguin

08-29-2004, 03:25 AM
Normally OpenGl does not draw such seems if you specify the exact same vertices coordinates for the adjacent polygons.
Don't do something like :
cube 1 right edge : center1 + 0.5
cube 2 left edge : center2 - 0.5

Just compute each vertice first, then send it :
cube 1 right edge : vertice 3
cube 2 left edge : vertice 3

Of course, your particular OpenGL implementation (hardware/software) may be flawed, but it is n ot likely.

Silkut
08-29-2004, 05:15 AM
The Voxel is really impressive !

08-29-2004, 08:44 AM
By the way I meant "seams" and not "seems"...

sacredPenguin
08-29-2004, 10:19 AM
but i use glutSolidCube and dont create the cubes by myself.

ZbuffeR
08-29-2004, 03:01 PM
You should create the cubes yourself, if you want the seams to disappear. It is not so hard. Or maybe use only integer coordinates, to eliminate floating point rounding errors.