Bienvenido a los foros de FT81x Manía. Te invitamos a regístrate totalmente gratis. Disfruta de tu experiencia con un grandes amigos y Staff.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Thread Contributor: jblazegScissor for Poly

#1
0
Hope it's ok when I use English because I'm German and I do not have that much space lef tin my brain for another foreign language ;-)

I'm using Poly to draw a certain graphic, but now I want to use Scissor to restrict the painting area. It's not working because "Poly" uses Scissor itself. Any ideas how to move forward?
Reply
#2
0
No problem, in as much as possible to us, we could be give you some support of our little knowledge.

Put the sketch in order to achieve the best solution to your issue.
Reply
#3
0
from here http://gameduino2.proboards.com/thread/106/drawing-arc

#define PAINT_ALPHA() GD.BlendFunc(ONE, ONE_MINUS_SRC_ALPHA)
#define CLEAR_ALPHA() GD.BlendFunc(ZERO, ONE_MINUS_SRC_ALPHA)

// Draw an arc centered at (x,y) with inner radius r0, outer radius r1.
// th0 and th1 are the starting and ending angles in Furmans.
// x,y,r0 and r1 are subpixel coordinates (1/16ths of a pixel).
// The arc itself is drawn into the destination alpha buffer for use in
// later compositing operations.

static void arc(int x,
int y,
uint16_t th0,
uint16_t th1,
uint16_t r0,
uint16_t r1)
{
GD.SaveContext();

GD.Begin(POINTS);
PAINT_ALPHA();
GD.PointSize(r1);
GD.Vertex2f(x, y);

CLEAR_ALPHA();
GD.PointSize(r0);
GD.Vertex2f(x, y);

Poly po;
po.begin();
po.v(x, y);
int ra = r1 + (r1 >> 1);
for (uint8_t d = 0; d <= 4; d++) {
int rx, ry;
GD.polar(rx, ry, ra, th1 + (((uint32_t)(uint16_t)(th0 - th1) * d) >> 2));
po.v(x + rx, y + ry);
}
po.draw();
GD.RestoreContext();
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)