# Primitives completely ignoring Z?

This topic is 3462 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

EDIT: Resolved. I'm a moron. 0.0f z Scale FTL :(. This has been driving me crazy for pretty much the last several hours (so much so, in fact, that I was driven to finally register and post here after lurking for eons). I'm far from a DirectX Virtuoso, so I suspect I'm just missing something obvious, but I can't figure it out or Google it for the life of me. Basically, I have your typical, fractal terrain engine. It's drawing the grid just fine in wireframe mode (or any mode), except that it completely ignores my Z/height coordinate, which makes it the most boring terrain engine ever, being capable of showing only a flat, square plain. I can animate by shifting it slowly along X and Y (with the expected results), but it does nothing with Z at all, even if I let it increment beyond the clipping planes. I've watched it in the debugger and there is definitely a value in Z -- the generation algorithm is working and generating what I suspect is very pretty terrain. But it does me no good because no matter how high or low Z is, it remains completely flat in the display. The code is:
            dxDevice.Clear(ClearFlags.Target, Color.Bisque, 1.0f, 0);
dxDevice.BeginScene();
dxDevice.VertexFormat = CustomVertex.PositionColored.Format;

dxDevice.Transform.World = TransformMatrix;
for (int i = 0; i < Map.MeshHeight - 1; i++)
{
CustomVertex.PositionColored[] verts = CurrentMap.GetStrip(i);

dxDevice.DrawUserPrimitives(PrimitiveType.TriangleStrip, (Map.MeshHeight - 2) * 2, verts);
}

dxDevice.EndScene();
dxDevice.Present();

I know DrawUserPrims is not the best way to go, but I've tried every possible function, this just happens to be the latest version of the code. All of them display the same symptom. Here are some of the sample vertices from a standard terrain gen:
Quote:
 X: 0 Y: 33 Z: 25.12481 X: 33 Y: 0 Z: 28.22867 X: 33 Y: 33 Z: 29.81911 ...
Any help greatly appreciated! Thanks. [Edited by - NoctisPax on May 31, 2009 2:11:59 AM]

##### Share on other sites
Is DepthStencil enabled?

1. 1
Rutin
73
2. 2
3. 3
4. 4
5. 5

• 21
• 10
• 33
• 20
• 9
• ### Forum Statistics

• Total Topics
633426
• Total Posts
3011816
• ### Who's Online (See full list)

There are no registered users currently online

×