-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
So what's going on with GL_POLYGON in the translate tool's arrow base? #129
Comments
It's an OpenGL codebase. It predates ES by at least a decade. |
I can never tell if you're being deliberately disturbing (@nigels-com) but FWIW what I think is the best explanation here is once upon a time this 8 sided polygon formed an arrow head with a 90 degree spike sticking out of the base, that would be flattened for the double-sided arrow. Much like the rest of the GLUI code it lacks a lot in the way of commonsense... I think someone came along and turned this 8 sided polygon into a square and added a second triangle to form an arrow... instead of doing the reasonable thing of drawing a quad and a triangle they felt for some reason it was important to preserve the original code that used the polygon... this OCD like tendency could explain why GLUI's code is so maddening (and completely untenable in terms of performance) throughout. (Edited: As for myself I just can't believe I never noticed that this polygon made no sense back when I was working on improving/overhauling GLUI. It seems I never stopped to look at it critically.) |
It's old code. Good for you for taking it forward into the modern age. |
[I initially thought it would have been some kind of arcane OpenGL trickery. It only later occurred to me it could have originally drawn the whole arrow instead of just the part beneath the triangle tip.] I realized after figuring out what the old polygon code was that it actually was possible to draw the arrow as a polygon (fan) if the tip of the arrow is the pivot. So this would be a better replacement. I've never understood what the GLUI project was for since it would not make simple changes like this one, as if it had some existential purpose besides functional code.
|
All pull requests are given due consideration, as always. Primarily GLUI is maintained for purpose of existing GLUI applications. |
glui/src/glui_translation.cpp
Lines 467 to 477 in 093edc7
FWIW here's some code that can replace it. I was adding an OpenGL ES mode (ANGLE) when I noticed this ... I don't know how I ever missed it before. I know I spent a lot of time with this subroutine. I just can't think of a rationale for using GL_POLYGON here so I'm curious. Notice also two vertics are duplicated.
The text was updated successfully, but these errors were encountered: