I want to imitate the well-known HTML's great great RECTANGLE. I mean all of the characteristic of the rectangles like borders
, border-radius
, triangulated quad on corners
, etc. I don't like to use any other libraries except mine. I would like to create this one for the sake of learning and experience, and also to use it for the future as a GUI system. I am working on this concept of shuffled rectangles.
It is composed of:
- 4
GL_TRIANGLES
as quadrilateral on corners - 4 arcs on corners
- 4 borders on all sides
- And one front big rectangle on the front
And these are the outputs I made so far :)
w/o border-radius
w/ border-radius
So the things I am really really confused with are
- Border-sizes
- Border-locations
- Is it the X, Y's or the W, H's
- When to draw or not front-most rectangle
- Anything I don't know yet.
...Please comment other things I should include here for clarification. Thanks!
Edit:
Hmm..., Okay as for a minimal question only. I just wanted to implement this stuffs and programmatically compute their values as I change a single attributes of the rectangle.
- border-radii-sizes
- border-sides
I'm putting too much images here, please please understand me :(
*left-border
*corner
I was thinking of that kind of rectangles positioning and it's really difficult in my head to compute for their coordinates or the sizes base on the set of attributes I'm gonna define on the designing part
. For example, If I define the border-radius-top-left
to have a value of 50% with its counter part of border-size-left
with a certain value, what would be the formula
I must consider. Or, must I need to add any component/ private attributes in order to make this thing happen?