Fill polygon gradient color
Posted: Mon Jun 22, 2015 8:17 pm
In Topic:
http://bb.donnay-software.com/donnay/vi ... 8&start=20
Jimmy gave the example of filling a triangle gradintnym color based on the colors at the vertices.
Is it possible to generalize this example:
- Given the coordinates and color 2 points - to build a line with a gradient color;
- Given the coordinates and color 3 points - to build a triangle with a gradient color;
- Given the coordinates and color of 4 points - to build a rectangle with a gradient color;
- Given the coordinates and color 5 points - to construct a pentagon with a gradient color;
..................
- Given the coordinates and color of N points - to build a n-gon with gradient color.
It is clear that any polygon can be divided into triangles and the triangle problem is solved. But the fact is that there are many ways to partition the polygon into triangles (the problem of triangulation). In addition it should be done. And maybe one team all provide.
http://bb.donnay-software.com/donnay/vi ... 8&start=20
Jimmy gave the example of filling a triangle gradintnym color based on the colors at the vertices.
Code: Select all
GraGradient(oPS, {0,aTmp[2]}, {{aTmp[1],0}, aTmp }, aColors1 ,GRA_GRADIENT_TRIANGLE)
*GraGradient(oPS, {0, 0}, {{aTmp[1],0}, aTmp }, aColors1 ,GRA_GRADIENT_TRIANGLE)
*GraGradient(oPS, {0,aTmp[2]}, {{0 ,0},{aTmp[1],0}}, aColors1 ,GRA_GRADIENT_TRIANGLE)
- Given the coordinates and color 2 points - to build a line with a gradient color;
- Given the coordinates and color 3 points - to build a triangle with a gradient color;
- Given the coordinates and color of 4 points - to build a rectangle with a gradient color;
- Given the coordinates and color 5 points - to construct a pentagon with a gradient color;
..................
- Given the coordinates and color of N points - to build a n-gon with gradient color.
It is clear that any polygon can be divided into triangles and the triangle problem is solved. But the fact is that there are many ways to partition the polygon into triangles (the problem of triangulation). In addition it should be done. And maybe one team all provide.