Very annoying terrain problem

Started by
5 comments, last by blueEbola 22 years, 1 month ago
Hi all, I've taken NeHe's terrain demo (tutorial 35) and I've added quadtrees to it. The quadtree seems to be working well, and the demo runs a bit faster. But the only problem is that when you move the camera, some of the quads dart out in unusual directions. It is very hard to explain but it's very ANNOYING! I have a screen shot here (and a zip file with the src + exe): http://www.geocities.com/blueebola/night_vision.html I circled the area that is the problem, as you can see its like some sort of polygon is darting out in one single direction. Anybody know how to fix this? This is the first time i ever got any kind of "tree" in anything and I am very excited Thanks in advance anyone who can help [edit: not tutorial 36, its tutorial 35... UGH] Edited by - blueEbola on February 23, 2002 2:58:45 PM
Advertisement
Check the vertices that are being sent to OGL. It''s possible that a vertex gets removed by your culling, and so OGL draws the incomplete tri/quad funny.
I''ve checked mostly everything in the rendering pipeline and it all seems fine.

This thing just doesnt want to work for me

I am beginning to wonder if its just the structure of the program thats giving me this or if its my quadtree I have made several little edits to my code (local) and all I can do is make it faster (by the means of better frustrum culling, and i switched to triangle strips for rendering). I switched to triangle strips with hope that it would just fix itself (hah, yeah right) but it still is acting up. Can somebody look at the code or diagnose possible reasons these quads are doing this?
Perhaps you are trying to render nonexistant vertices. That''s what it look like to me.
Perhaps you are trying to render nonexistant vertices. That''s what it look like to me.
I think that may be the problem (in fact, I am pretty sure that is). I just don''t know when and where the vertices are being rendered at, so I have no idea where it is happening.

Another thing,

I changed the height map from a 1024x1024 raw file to a 32x32 one and the terrain looks great except that some tri strips are sticking to the origin (0.0f,0.0f,0.0f), as if it was specified as one of the vertices. Switching down to a smaller size of a height map seemed to have helped and I may be able to figure out whats wrong faster (hopefully) but has anybody ever experienced this kind of thing with models or even terrain before? I am looking for common problems that could have caused this behavior but I still can''t find anything. Thanks again
AHA!

I have fixed it

Thank you AP the problem was exactly as you said, non existent vertices (thanks mikey too I found the problem by checking to see if a vertex''s value is the origin (which in the heightmap i have, should not exist) and then outputting some data to check out where and when it was happening... i found that my dum program was trying to display a vertex out of the bounds of the array. Heh, and to think i''d been pondering over this for about a week and a half..

Thank you anybody who tried to help!!

This topic is closed to new replies.

Advertisement