sf2dlib icon indicating copy to clipboard operation
sf2dlib copied to clipboard

sf2d_draw_line() thickness glich

Open quizque opened this issue 9 years ago • 5 comments

Im currently working a 3DS app and there is no complex shapes yet so i had to use lines. While using the draw line function i saw that the lines where changing thickness. If there is something i missed or there is a fix please tell me.

quizque avatar Jan 22 '16 19:01 quizque

The problem is that the 3DS's GPU doesn't have the LINE or POINT primitive, so I have to use a TRIANGLE_STRIP to draw a line, which as you can see doesn't really look very good :/

xerpi avatar Jan 22 '16 19:01 xerpi

Oh, ok thanks, I think im just going to try and use an image. But i found if you draw multiple lines in the same spot it will get thick not by that much though.

quizque avatar Jan 22 '16 19:01 quizque

#27 hopefully this should satisfy the need for line thicknesses :)

renb0 avatar Mar 04 '16 13:03 renb0

Thank you so much. You can close this issue now :)

On Mar 4, 2016, at 8:35 AM, Mik [email protected] wrote:

#27 hopefully this should satisfy the need for line thicknesses :)

— Reply to this email directly or view it on GitHub.

quizque avatar Mar 04 '16 14:03 quizque

Well, it looks like it still happens, even with vertical or horizontal lines. HEre's a sample code I did from playing with your example :


void drawScene(int offset3d, int c_offset, int cy_offset)
{
  /*
  sf2d_draw_fill_circle(offset3d + 60, 100, 35, RGBA8(0x00, 0xFF, 0x00, 0xFF));
  sf2d_draw_fill_circle(offset3d + 180, 120, 55, RGBA8(0xFF, 0xFF, 0x00, 0xFF));

  sf2d_draw_rectangle_rotate(offset3d + 260, 20, 40, 40, RGBA8(0xFF, 0xFF, 0x00, 0xFF), -2.0f*rad);
  sf2d_draw_rectangle(offset3d + 20, 60, 40, 40, RGBA8(0xFF, 0x00, 0x00, 0xFF));
  sf2d_draw_rectangle(offset3d + 5, 5, 30, 30, RGBA8(0x00, 0xFF, 0xFF, 0xFF));
  sf2d_draw_texture_rotate(tex1, offset3d + 400/2 + circle.dx, 240/2 - circle.dy, rad);
  */
  draw_border_rectangle(65 + offset3d + (c_offset * 1 /3), 65 + offset3d + (cy_offset * 1 /3), 80, 240-75, RGBA8(0x2D, 0x2D, 0x2D, 0xFF), RGBA8(0xDE, 0xDE, 0xDE, 0xFF));
  draw_border_rectangle(90 + offset3d + (c_offset * 2 /3), 150 + (cy_offset * 2/3), 80, 90, 0xFF333333, RGBA8(0xDE, 0xDE, 0xDE, 0xFF));
  draw_border_rectangle(10 + offset3d + (c_offset * 2 /3), 150 + (cy_offset * 2/3), 40, 90, 0xFF333333, RGBA8(0xDE, 0xDE, 0xDE, 0xFF));
  draw_border_rectangle(0, 200 + cy_offset, 400, 40, 0xFFDEDEDE, RGBA8(0xDE, 0xDE, 0xDE, 0xFF));
  draw_border_rectangle(120 - offset3d +( c_offset * 4/3), 220 + (cy_offset * 4/3), 40, 20, RGBA8(0xD6, 0x49, 0x37, 0xFF), RGBA8(0xDE, 0xDE, 0xDE, 0xFF));
}

... (in main)
    sf2d_start_frame(GFX_TOP, GFX_RIGHT);
      drawScene(offset3d, circle.dx, -circle.dy);
        sf2d_end_frame();

    sf2d_start_frame(GFX_TOP, GFX_LEFT);
    drawScene(-offset3d, circle.dx, -circle.dy);
        sf2d_end_frame();

Also, unrelated question : how do you manage a correct 3D effect? I'm trying to get to making a decent depth example to see what kind of acceptable value there is to make multiple depth layers, but I hardly find a way to make a decent 3D (ghost images around the rectangles I'm drawing in said sample example I tweaked.)

Regards.

(PS : gotta find a way to communicate with you about this lib outside this repo.)

Eiyeron avatar Apr 15 '16 19:04 Eiyeron