DGL
https://delphigl.com/forum/

rotating a fill (2d)
https://delphigl.com/forum/viewtopic.php?f=19&t=8717
Seite 1 von 1

Autor:  noeska [ So Okt 04, 2009 13:06 ]
Betreff des Beitrags:  rotating a fill (2d)

For my glvg project i use gradient fills. Fills are applied using the stencil buffer e.g. first the shape is drawn in the stencil buffer next the fill is drawn over that.
Now that goes ok for not rotated fills on square shapes. But goes wrong with a rotated shape on a rectangular shape. (with and height are different).
So if i rotate a fill 90 degrees with and height will 'swap' making the fill not fill the entire shape. So somehow i need adjust sizes of the rotated fill so that it overlaps the shape again.
I have been puzzling with this for a while and so far i have not found a 'good enough' solution. If you have ideas on this let me know...

Autor:  noeska [ Mo Okt 05, 2009 09:27 ]
Betreff des Beitrags: 

solved...

it also involved rotating around a point.
i use gltranslatef and glrotatef also i do a manual rotatation around a point to get the correct new x point. Both methods were a bit out of sync and i had some nasty left over code in the box drawing that overruled the outcome coords partly, next i 'fixed' a part that was correct in the first place and i got some chaos :-( .

Lessons learned. Keep your code clean and simple as possible ...

Seite 1 von 1 Alle Zeiten sind UTC + 1 Stunde
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/