When attempting to draw a box with the attached code, this OpenVG
implementation does not produce expected results as the Khronos
implementation does.

Suspected area of issue is either improper translation of (ox, oy) during
vgRotate or VG_LINE_TO_REL command being treated as VG_LINE_TO_ABS.

First image is the result from this implementation:
http://www.nabble.com/file/p25068115/box_mesa.jpeg 

Second image is the result from khronos implementation:
http://www.nabble.com/file/p25068115/box_khronos.jpeg 

Drawing code is inserted and attached:
VGint WIDTH = 400;
VGint HEIGHT = 400;

VGPath star, line;

VGfloat clearColor[4] = {1.0, 1.0, 1.0, 1.0};
VGubyte cmds[] = {VG_LINE_TO_REL};
VGfloat coords[]  = {WIDTH/4.0, 0.0};

void draw()
{
        int i;
        
        star = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F, 1, 0, 
0,
0, VG_PATH_CAPABILITY_ALL);
        line = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F, 1, 0, 
0,
0, VG_PATH_CAPABILITY_ALL);

        vgAppendPathData(line, 1, cmds, coords);

        vgSeti(VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE);
        vgLoadIdentity();

        for(i=0; i<4; i++)
        {
                vgTransformPath(star, line);
                vgRotate(90.0);
        }
                
        vgSetfv(VG_CLEAR_COLOR, 4, clearColor);
        vgClear(0, 0, WIDTH, HEIGHT);

        vgLoadIdentity();
        vgTranslate(WIDTH/2.0 - WIDTH/8.0, HEIGHT/2.0-HEIGHT/8.0);
        vgDrawPath(star, VG_STROKE_PATH);
}

http://www.nabble.com/file/p25068115/draw_star.c draw_star.c 
-- 
View this message in context: 
http://www.nabble.com/OpenVG-Bug%3A-Either-vgRotate-or-VG_LINE_TO_REL-tp25068115p25068115.html
Sent from the mesa3d-dev mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to