MIDP 1.0: Filled rectangles

Discussion in 'Java' started by Michal Pleban, May 26, 2004.

  1. Hello!

    I'm beginning to develop a 3D game for J2ME mobile phones. The obvious
    problem is, how to draw filled triangles. I know that in MIDP 2.0 this
    can be done easily, and Nokia has an extension to MIDP 1.0 which
    allows to draw filled polygons. Now the problem is how to do it in
    plain MIDP 1.0 (say, on a Motorola T720 or SonyEricsson T610). I
    thought of two solutions:

    * Use two or three fillArc() invocations. Each of them would paint an
    arc which has a center in one triangle vertex. The arcs can be scaled
    so that they cover the whole triangle and never paint outside the
    triangle. Or perhaps even one arc can be used which approximates the
    triangle well, especially when it's small.

    * Divide the triangle into horizontal and vertical lines and draw them
    using drawLine().

    The second method requires (or at least appears to require) more code,
    and uses much more drawing operations than the first, so it seems to
    be slower. But on the other hands, perhaps scaling the arc and
    painting it would be much time-consuming?

    If you have any experience or insight about this problem, I'd be very
    grateful.

    Regards,
    Michau.
     
    Michal Pleban, May 26, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    533
  2. Ajay Patil
    Replies:
    0
    Views:
    462
    Ajay Patil
    Dec 10, 2003
  3. Chuck Dillon
    Replies:
    4
    Views:
    1,086
    Steve W. Jackson
    Feb 10, 2004
  4. nishadixit
    Replies:
    5
    Views:
    1,302
    Joe Discar
    Jun 1, 2005
  5. Fahad
    Replies:
    1
    Views:
    618
    Andrew Thompson
    Aug 8, 2005
Loading...

Share This Page