Transition from the old opengl to the modern opengl

[QUOTE=sajis997;1280215]
My question is "Is it possible to generate the hilbert curve only for region bounded by the trimmed bounded area or you only focusing on the trimmed bounding area from the much larger region(2¹⁶ X 2¹⁶ steps) of hilbert curve? [/QUOTE]
If a particular sub-curve doesn’t intersect the region of interest, then there’s no need to trace out the complex path of a hilbert curve; you can just move in a straight line of 2N-1 steps. Each curve always starts at (0,0) and ends at (2*K-1,0) where K=2N-1 (the curve’s coordinate system can have one of four rotations, so the actual direction of movement may be up, down, left or right, but it will always be 2N-1 steps along an axis).

My Python snippet doesn’t address this directly. It does compute the bounds of the curve being drawn at each level, but doesn’t use this information.

The code assumes the existence of a function line(x1,y1,x2,y2) which handles the individual steps. In the case of a complete curve, the starting (x1,y1) position for any call after the first will always be equal to the finishing (x2,y2) position for the previous call. If you skip sub-curves, that won’t necessarily be the case, so you would check whether each line continues from the previous line and either “draw” or “move” accordingly.