PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Need help to test rotation & clipping in 2.02

Hi,

Tedson reported in that clipping does not work in conjunction with rotation center in GD 2.02. On my computer however it does. I would need a sample with a repeatable error so I can fix it up before I leave to Siggraph next week.

By the way. Line clipping is broken in GD 2.02. GapiDraw uses the 1D Sutherland Hodgman line clipping algorithm. While faster than the Cohen-Sutherland, it was unfortunately not implemented correctly.

The next release GD 2.03 due out early next week will be a pure bugfix release. So please test as much as you can on GD 2.02.

//Johan
Hello Johan,

I guess the problem I experience is related to the broken line clipping algorythm but anyways.

Here is the code to test:
Code:

TCHAR str1[] = TEXT("0123456789abcdefghijklmonpqrstuvwxyz");
CGapiBitmapFont* pSystemFont = m_display.GetSystemFontBorder();
RECT rect;
::SetRect(&rect, 10,10,230,310);
backbuffer.SetClipper(&rect);
backbuffer.DrawLine(0,0,240,320,RGB(255,200,200),0,0);
::SetRect(&rect, 1,1,100,100);
backbuffer.DrawRect(&rect,RGB(200,200,255),0,0);
backbuffer.DrawText(200,150,str1,pSystemFont,0,0,0,0);


The rectangle is not rendered correctly as its vertical part is misplaced. Please follow this URL for picture reference: http://www.pbase.com/image/19183536
Look for the blue rectangle part.
Heh, Sparkie beat me to it. I was just going to post that the right side of DrawRect was offset by one pixel too many. The top, left and bottom sides draw correctly, but the right side is too far to the right by one pixel.
I cant view the code. What browser are you using? Mine is IE 5.0
I'm using IE6 and everything is fine. The latest update to the code viewer seems to not like IE5.
Thanks GR :P
yep, drawrect is also flawed. I changed it internally to call drawline, and forgot the "exclusive" part.. I'll release a fixed version on Sunday - please report back as much as possible before then...