PocketMatrix forums

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

Filled polygons

I know filled polygons are not implemented in GapiDraw, and it shouldn't be a problem to add it ourselves. Still, it requires some work, and I would rather focus on doing something original than on reimplementing what has already been done before. I couldn't find any good info on this while browsing the forum, so my question is:

Is there anyone who has implemented filled polygons with GapiDraw and would be willing to share?

/Magnus
I haven't done it for GD, but I suggest downloading PocketFrog 0.7.0. That's the last version I released when I was maintaining it. One of the functions I added was a fairly well-performing filled poly function, and it should be trivial to port it.
In other words "I have no idea how to do this, please give me code". People are soo lazy these days, makes you understand how soo much buggy software gets written.
I probably shouldn't bother replying to an anonymous poster, but...

I've been programming in one form or another for over 20 years now. One thing I've come to realize over the past 3-5 years is that there is a fundamental shift in the world from the mentality that each person should write everything themselves, to the mentality that you should look for pre-built components in your project.

The rationale is simple: why spend your time implementing code that has already been implemented millions of times, and likely better than you could anyway at least some of the time? Why not put your efforts into solving your real problem and not re-inventing the wheel?

That not to say that you should always look to avoid writing your own code. Of course sometimes you should, and even have to. If your a beginner it is vitally important that you try and write your own code as often as possible for the sheer value of the learning experience it is.

But if you are an experienced coder, little more than ego (most of the time) makes you want to write everything yourself. There is no other good reason to do so in probably 80% of the cases you could name. Sometimes you have to, sometimes you just plain WANT to, but there's no reason to fault someone who doesn't want to spend their time doing something that so many have already done.

Calling someone lazy for asking if anyone has existing code to share indicates a naive thinking process on your part, not the guy who's asking for the code. It indicates that, more than likely, your ego overwhelms good sense. Your assertion that people not writing their own code leads to buggier code has been disproven time and time again. It is a generally accepted fact that using code from others, assuming the source of the code is someone that is viewed as providing good code, will yield more stable software, not less.
I agree with most of what was said, but if you look at the first post, all he did was "browse the forum".

If you have any ambition at all, you can use a search engine or someplace like gamedev.net or flipcode to find an answer to your problem. If you dont know about these resources, then you probably are new and should be writing your own code.

Code reuse is great when you are sure that the problem has been properly solved before hand, asking random people for code would not seem to satisfy this.

As with your coding shift comment, i too believe using tools availible is a great thing, heck were using gapidraw. I also see a shift in general of people who believe everything should be done for them and are responsible for nothing. I suppose I kind of let this bleed into this subject, but thats where it orignally came from.
Eh, I did want to add this:


it requires some work


Thats what really irqued me...... Everyone seems to be extremely lazy and expects other people to do everything for them.
fzammetti wrote:
I haven't done it for GD, but I suggest downloading PocketFrog 0.7.0. That's the last version I released when I was maintaining it. One of the functions I added was a fairly well-performing filled poly function, and it should be trivial to port it.


Thanks, I'll take a look at that. At the moment I'm working on vector map compression routines which I find much more interesting than filling polygons.

/Magnus