Ear-Clipping | points using Ear Clipping with a sample OpenGL program
kandi X-RAY | Ear-Clipping Summary
kandi X-RAY | Ear-Clipping Summary
Source code that correlates with the article located at:.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Ear-Clipping
Ear-Clipping Key Features
Ear-Clipping Examples and Code Snippets
Community Discussions
Trending Discussions on Ear-Clipping
QUESTION
I get a random contour as an input. I need to transform it into a polygon and display it in 3d space. (A)
Normally, I would do it through a standard ear-clipping algorithm, and the result will be something like (B)
However due to a bug in the graphics drivers for the video card I'm working on (VIVANTE GC 2000), I can only triangulate small shapes like that. The reason is that when rendering, if a vertex of a mesh lies too far outside of frustum to the left or right - the position is calculated incorrectly. This results in wild flickering and deformation of large meshes on the screen. It is a confirmed driver issue, and it doesn't happen on other platforms or even with the older version of drivers for the same videocard. Unfortunately, I can't use the old drivers, and the card manufacturer isn't likely to fix the bug, seeing it's been known for almost a decade.
Here's a relates SO thread going a bit more in-depth of the problem OpenGL Perspective Projection Clipping Polygon with Vertex Outside Frustum = Wrong texture mapping?
So I have to use crutches. In other words - I have to split my mesh into several smaller triangles, something like (C) So that at any point in time, the vertexes of the triangles rendered are not outside of frustum too far.
Unfortunately, there's really no way to do it otherwise that I see. I know this is a very inelegant solution, but there really no other way to get around the driver bug.
But I'm stuck at actually doing it. Somehow, I can't wrap my head around how I should generate the triangulated data (A -> C). Can someone help me with an algorithm of splitting/triangulating mesh in such a way or give ideas? Assume that all "squares" are N-by-N squares with N being specified by me.
Or maybe someone has some other suggestions how I could deal with the problem.
...ANSWER
Answered 2020-Jun-23 at 07:02I guess you could consider to continue subdividing each one of the triangles once you have B, like this:
as many subdivisions as needed:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Ear-Clipping
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page