MIDP 1.0: Filled rectangles

M

Michal Pleban

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top