c# - DirectX Z order -
i have draw map managed directx. map arrived in mapinfo format (lines, polylines, regions/polygons). polygons triangulated (done glutesselator).
the idea:
- gps coordinates converted x,y points (mercator projection)
- i use positioncolored vertexformat
- center of view [x,y] (can modify mouse move)
- camera positioned [x,y,z] z zoom (-100 default, can modify mouse wheel)
- camera target is: [x,y,0], camera up: [0,1,0]
- the layers of map positioned z (+1.0, 0.99, 0.98, 0.97...etc)
i can do:
- draw lines , polylines
- draw 1 layer of polygons
my problem is: when want draw layers see 1 of them. think there problem z ordering. should solve this? modify renderstate? best if draw in gdi (first in back, last in front).
other question: how can coordinate of pixel under mouse cursor? (in gdi version of map because used own viewport rendering, directx everything)
thanks!
if map purely 2d, make sure z buffering turned off. once is, things display in order draw them in.
Comments
Post a Comment