Why Libgdx Gdx.gl10.glLineWidth(width); does not react to change projection properities

I have typical Libgdx class with render() function.

In render() function i have ShapeRenderer batch:

Gdx.gl10.glLineWidth(width);
renderer.begin(ShapeType.Line);
renderer.setColor(25,0, 0, alpha);
renderer.line(point_x1, point_y1, point_x2, point_y2);
renderer.end(); 

in this function I have also:

        camera.update();
        renderer.setProjectionMatrix(camera.combined);

and when the projection properities is changed line points are translated properly but line width is still the same!

Is there any way to change line width due to projection width and height ??

regards

Answers


Line width is given in pixels, which is just not influenced by any projection transformations. So there is no easy way to make the line width dependent on the current projection transformation and you won't get around replacing your lines by real 2-dimensional geometry (i.e. rotated rectangles or something the like).


Need Your Help

Access certain array that has a certain value in it's name

javascript php arrays variables

I'm trying to make a html Sudoku gameboard that loads a different puzzle depending on the php $_GET['level'] and $_GET['puzzle'] values. Php variables $get_level and $get_puzzle are set to the $_GET

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.