mithun_daa
01-13-2004, 10:19 AM
i have some data that is being passed to my routine. this is contour lines data. the data contains of x,y values. i have to draw lines from these x,y values creating a polyline. these lines need to be drapped onto my terrain, but they dont come with the z values. there are 2 alternatives to choose :
1. i create a bitmap from the x,y points. the bitmap will contain contour lines and the remaining pixels in the bitmap are transparent. but this would call for drawing lines by myself maybe using Bresenhams algorithm, which would be time consuming since there could be thousands of data points.
2. another approach i am thinkin of is, i draw lines from the data points using glvertex, then get a snapshot of the frame buffer which has only the contour lines, make a texture out of it, and then drape it. but for this method, i will have to draw the lines (using glvertex) and not render them. if i render them, i dont know how its goin to look with my terrain already there. is there any way i can draw the contour lines in the back buffer, and get the data, convert it to a tex, and render the tex, and not the lines.
any suggestions on how to go about the second approach or any better suggestions are welcome.
1. i create a bitmap from the x,y points. the bitmap will contain contour lines and the remaining pixels in the bitmap are transparent. but this would call for drawing lines by myself maybe using Bresenhams algorithm, which would be time consuming since there could be thousands of data points.
2. another approach i am thinkin of is, i draw lines from the data points using glvertex, then get a snapshot of the frame buffer which has only the contour lines, make a texture out of it, and then drape it. but for this method, i will have to draw the lines (using glvertex) and not render them. if i render them, i dont know how its goin to look with my terrain already there. is there any way i can draw the contour lines in the back buffer, and get the data, convert it to a tex, and render the tex, and not the lines.
any suggestions on how to go about the second approach or any better suggestions are welcome.