Beginner problem (maybe?)

Started by
8 comments, last by MindWipe 21 years, 6 months ago
I'm a newby to 3d programming, thought I would do as most people and begin with creating a terrain engine. After many tries I get this: Can anyone explain what I've been doing wrong? Because it should look like a normal landscape (from green to black depending on height). And I know the heightmap is okey /MindWipe [EDIT] WTF did I upload it as a bmp? [/EDIT] [edited by - MindWipe on October 20, 2002 3:35:08 PM]
"To some its a six-pack, to me it's a support group."
Advertisement
It seems like the problem is that it draw some of the verticles in wrong order!?

/MindWipe
"To some its a six-pack, to me it's a support group."
And here''s another one (jpg this time )



/MindWipe
"To some its a six-pack, to me it's a support group."
Try drawing the vertices from farthest away... It my have somthing to do with the Z-Order...
Very nice Mr. MindWipe

I''m assuming that we are not seeing certain triangles that we should be seeing.

It does look like it might be a culling problem but hard to know at this point. If you reveresed the culling you shouldn''t be able to see any landscape if it is culling properly. You might try that as a test.


Guy, I regress: WW, TTC, THTV.
Hmm...well, I think the problem has something to do with the Zbuffer.

lpD3DDevice->SetRenderState( D3DRS_ZENABLE, TRUE );

lpD3DDevice->SetRenderState( D3DRS_CULLMODE, D3DCULL_NONE );

lpD3DDevice->SetRenderState( D3DRS_LIGHTING, FALSE );

I use that.. but then when I D3DCLEAR_ZBUFFER to the Clear, it doesn''t fill the bg with the color. So everything that has been drawn is left there!?

I''m a newby as I said

/MindWipe
"To some its a six-pack, to me it's a support group."

Not sure whats going on.

Try: D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER

That should clear the screen and the buffer.
If you are not trying that already.
Though by the artifacts I see, there is probably less than 50 % probability that would work.


Guy, I regress: WW, TTC, THTV.
Problem solved. I didn''t create a Z-buffer ^__^

/MindWipe
"To some its a six-pack, to me it's a support group."
Good to hear.
Now you have pertty landscape.

Guy, I regress: WW, TTC, THTV.
Post a pic of what it looks like now :D!

This topic is closed to new replies.

Advertisement