Advertisement

problems with z-distance

Started by March 10, 2003 11:36 PM
2 comments, last by jverkoey 21 years, 11 months ago
ok, for some reason, in my racing game I am developing, I can go on a straight course that goes till about -120000 units (OpenGL units)...the thing is, once I hit about -3000 units, my ship starts sinking below the track.....even though the track is perfectly level, along with the ship....... any reason behind this? also, is there a way to stop that stupid glitch with opengl and the polygons of two objects blending together (even though they''re far apart, when you get far enough away, they start meshing together and you see a bunch of triangles around the edges) *sheesh*, opengl can be annoying sometimes bloodright.150m.com //For the latest on all of the IVGDA projects!
I can''t help you with your sinking problem without seeing code since there could be may reasons why this is happening.
If your ship is supposed to be a fixed height, then something (probably your physics routine) is modifying where your ship rests.

As for the flicking polygons, it''s called z-fighting and it''s not an openGL problem per se, but an implementation issue.
I''m sure a quick google will help point you in the direction of some tutorials on avoiding this problem.

From memory, altering the size of the models and fiddling with the near/far planes of your view volume helps. There are definite steps to take to avoid z-fighting, so have a look about gamedev.net.
I like pie! - weebl.
Oneiric - Another graphics engine in the works.
Advertisement
well, me and the other programmer on my team have looked over the code many, many times, and there are only two main translates in the code....

the first translate is to move the ship back on the z plane and left or right on the x plane for its movement

the second translate is for the track, where all of the polygons are drawn in a STRAIGHT line back on the z-plane....so there''s not really anywhere that it should be angling down......

bloodright.150m.com //For the latest on all of the IVGDA projects!
Have you tried outputting the coords of the ship as it travels along against time and any other important vars?

You should see when it sinks in the output set and should be able to trace/debug from there.
I like pie! - weebl.
Oneiric - Another graphics engine in the works.

This topic is closed to new replies.

Advertisement