OpenGL Line Width

前端 未结 4 1746
温柔的废话
温柔的废话 2020-11-30 13:59

In my OpenGL app, it won\'t let me draw a line greater then ten pixels wide. Is there a way to make it draw more than ten pixels?

void OGL_Renderer::drawLin         


        
4条回答
  •  误落风尘
    2020-11-30 14:35

    Ah, now that I understood what you meant:

    1. draw a one by one square.
    2. calc the length and orientation of the line
    3. stretch it to the length in x
    4. translate to startpos and rotate to line_orientation

    or:

    1. get vector of line: v :(x2 - x1, y2 - y1)
    2. normalize v: n 3- get orthogonal (normal) of the vector : o (easy in 2d)
    3. add and subtract o from the line's end and start point to get 4 corner points
    4. draw a quad with these points.

提交回复
热议问题