Wait a minute...something's wrong(?)

Started by
28 comments, last by Xelius 23 years, 6 months ago
Ok, I've been trying to figure out the problem myself, but I'm not quite sure if I've deduced correctly. I'm creating a terrain viewer which uses an array of heigh values to generate triangle strips for 3D generating. Currently, it works except that you have parts of the map object disappear as the stupid thing rotates. You can find the executable at http://www.geocities.com/clearvus/terrain.zip That's all you need. Run it and please let me know if you get weird stuff showing up too. Right now, I'm running it on my laptop, and it's 3D card has been known to have some interesting qwirks Thanks! -=xelius=- Edited by - Xelius on 10/4/00 11:27:36 AM
-------------------"Pointer?" -Anonymous-=Xelius=-
Advertisement
You using gl or d3d? And are you doing any manual culling?
If you''re using gl and are not culling, then I''d look to make sure your surface normals are correct, and that your depth buffering is set properly. I''m thinking you''ve flipped your surface normals around: check the winding of your triangle strips.

Morbo
Sorry. I''m using D3D...I guess I should have said that. D''oh!
Okay, um, as far as the data goes in the triangle strip, I have an array of floats [20][20].
Then, I have a loop that goes through (where map is the array):

    for (y=0;y<19;y++){    for (x=0;x<20;x++)    {         strip[y][c++] = D3DVERTEX(D3DVECTOR((float)x-10,map[y][x],(float)y),D3DVECTOR(0.0f,1.0f,0.0f),0,0);         strip[y][c++] = D3DVERTEX(D3DVECTOR((float)x-10,map[y+1][x],(float)y+1),D3DVECTOR(0.0f,1.0f,0.0f),0,0);    }    c = 0;}    


Then it renders it using:

Device->DrawPrimitive(D3DPT_TRIANGLESTRIP ...blah blah blah)

If, in fact, my faces are defined incorrectly, I''m not sure how I would determine the correct way to define them. Any ideas? (I''m thinking maybe the face/vertex normals(?))

Thanks
-------------------"Pointer?" -Anonymous-=Xelius=-
What do you have your far and near clipping planes set at? If your far clipping plane is set too close, it would clip the corners off. That''s probably not it though...

Nope, that''s not it. It''s, as far as I can tell, 1 of two things:
1) Face normals are setup improperly
2) I need some sort of depth buffer...dunno. I''m not experienced enough in 3D Graphics to be able to tell.

-=xelius=-
-------------------"Pointer?" -Anonymous-=Xelius=-
Hmm...no one else seems to want to help me out

*sigh*
Looks like network debugging...


Thanks again.
-------------------"Pointer?" -Anonymous-=Xelius=-
Well, on my computer the app just shuts down as soon as I start it up. It creates a window, goes fullscreen, and closes. Well, are you using a Z-Buffer, or sorting the polygons at all? If you aren''t then as the thing rotates, the polygons behind will come in front of polygons nearer the viewer, because the drawing order has not changed to take z-position into account.

------------------------------
#pragma twice


sharewaregames.20m.com

Hmmm..
Ok. I''ll check that out. Thank you!

-=xelius=-
-------------------"Pointer?" -Anonymous-=Xelius=-
Well...

I am using OGL, but it aplies every where.

1- You need to do some z-buffering, in OGL it''s s simple as 1 function call. I dunno about d3d.

2- Check your near clipping plane and far plains, play with the values till it looks right.
Hardcore Until The End.
looks like a depth problem, cuz i draws over during 1/2 the rotation, thats when the vertecies ur starting with(For the render) are at the front, when they''re at the back, its drawing backto front and so it looks fine

the wymsical wyvern

This topic is closed to new replies.

Advertisement