PDA

View Full Version : rotating a fill (2d)



noeska
04-10-2009, 12:08 PM
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...

paul_nicholls
05-10-2009, 01:23 AM
Would you have a screenshot you could show us of the problem to clarify?

cheers,
Paul

noeska
05-10-2009, 08:23 AM
i cannot anymore as it is solved...

but it involved also 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 :-( .

Now i need to bring back the more then 2 color gradients code part back to live.