Drawing a Topographical Map

前端 未结 9 2274
遥遥无期
遥遥无期 2020-12-22 21:31

I\'ve been working on a visualization project for 2-dimensional continuous data. It\'s the kind of thing you could use to study elevation data or temperature patterns on a 2

9条回答
  •  旧巷少年郎
    2020-12-22 22:03

    I recommend the CONREC approach:

    • Create an empty line segment list
    • Split your data into regular grid squares
    • For each grid square, split the square into 4 component triangles:
      • For each triangle, handle the cases (a through j):
        • If a line segment crosses one of the cases:
          • Calculate its endpoints
          • Store the line segment in the list
    • Draw each line segment in the line segment list

    If the lines are too jagged, use a smaller grid. If the lines are smooth enough and the algorithm is taking too long, use a larger grid.

提交回复
热议问题