Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8299947
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T16:21:27+00:00 2026-06-08T16:21:27+00:00

Where can I get an algorithm to render filled triangles? Edit3: I cant use

  • 0

Where can I get an algorithm to render filled triangles? Edit3: I cant use OpenGL for rendering it. I need the per-pixel algorithm for this.

My goal is to render a regular polygon from triangles, so if I use this triangle filling algorithm, the edges from each triangle wouldn’t overlap (or make gaps between them), because then it would result into rendering errors if I use for example XOR to render the pixels.

Therefore, the render quality should match to OpenGL rendering, so I should be able to define – for example – a circle with N-vertices, and it would render like a circle with any size correctly; so it doesn’t use only integer coordinates to render it like some triangle filling algorithms do.

I would need the ability to control the triangle filling myself: I could add my own logic on how each of the individual pixels would be rendered. So I need the bare code behind the rendering, to have full control on it. It should be efficient enough to draw tens of thousands of triangles without waiting more than a second perhaps. (I’m not sure how fast it can be at best, but I hope it wont take more than 10 seconds).

Preferred language would be C++, but I can convert other languages to my needs.

If there are no free algorithms for this, where can I learn to build one myself, and how hard would that actually be? (me=math noob).

I added OpenGL tag since this is somehow related to it.

Edit2: I tried the algo in here: http://joshbeam.com/articles/triangle_rasterization/ But it seems to be slightly broken, here is a circle with 64 triangles rendered with it:
enter image description here

But if you zoom in, you can see the errors:
enter image description here

Explanation: There is 2 pixels overlapping to the other triangle colors, which should not happen! (or transparency or XOR etc effects will produce bad rendering).

It seems like the errors are more visible on smaller circles. This is not acceptable if I want to have a XOR effect for the pixels.

What can I do to fix these, so it will fill it perfectly without overlapped pixels or gaps?

Edit4: I noticed that rendering very small circles isn’t very good. I realised this was because the coordinates were indeed converted to integers. How can I treat the coordinates as floats and make it render the circle precisely and perfectly just like in OpenGL ? Here is example how bad the small circles look like:

enter image description here

Notice how perfect the OpenGL render is! THAT is what I want to achieve, without using OpenGL. NOTE: I dont just want to render perfect circle, but any polygon shape.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T16:21:29+00:00Added an answer on June 8, 2026 at 4:21 pm

    There’s always the half-space method.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can get this to work: [<DllImport(user32.dll)>] extern bool GetClientRect(nativeint, RECT*) let getClientRect hwnd
I can get the current selected row in this way: private void DataGridView1_CellContentClick(object sender,
I'm implementing an algorithm about pencil rendering. First, I should render the model using
How can I efficently interpolate per-pixel two textures A and B by a dynamic
I been working on this code for a while and can't seem to get
For image scanning purposes, I'd like a pixel (which I can get from a
I am looking for an algorithm that can get the object that called the
When I try to use ['signed_request'] in PHP, I can't get [page][liked] / Page
Can get all triples with value null in specific field? All people with date_of_birth
We can get class Class object by 3 methods: MyClass.class obj.getClass Class.forName(className) I don't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.