Recent

Author Topic: How to detect Merged vertecies / vertexes on the same Edge line in a Polygon  (Read 2158 times)

Key-Real

  • Sr. Member
  • ****
  • Posts: 362
I render Polygons.
The situation is that I have a polygon which some vertexes are merged / vertex is on the same Edge Line, so i have a triangle.

Look at the image.
This Triangle is a 4 vertex Poly.

As it is, It will not pass the culling test and the rasterizer will drop this poly.


How to detect such vertecies?
« Last Edit: August 24, 2023, 12:07:50 pm by Key-Real »

wp

  • Hero Member
  • *****
  • Posts: 12298
Iterate over the four vertices and check for equality?

Key-Real

  • Sr. Member
  • ****
  • Posts: 362
yeh, that's what I'm fearing of. :(

I thought it would be a fast algorithm for that.

wp

  • Hero Member
  • *****
  • Posts: 12298
Why is it important to find duplicate vertices? In the function that you posted in the other thread, duplicate vertices would simply add zero to the sum.

Key-Real

  • Sr. Member
  • ****
  • Posts: 362
It still not working in some cases :(

see the image above

Key-Real

  • Sr. Member
  • ****
  • Posts: 362
The Culling doesn't work only in NDC Space,

if it is not about the topic problem, I don't knew :(


EDIT:
 I had a DOT Product error in my calculations!
 I edited my post at the
https://forum.lazarus.freepascal.org/index.php/topic,64376.0.html

thread,
now everything works fine
« Last Edit: August 24, 2023, 05:00:53 pm by Key-Real »

Key-Real

  • Sr. Member
  • ****
  • Posts: 362
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

PLEASE DELETE THIS THREAD!!!!!!!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

 

TinyPortal © 2005-2018