Skip to main content
edited tags
Link
user1430
user1430
added 74 characters in body
Source Link
Greg Quinn
  • 362
  • 1
  • 10

I'm developing an application in Unity3D where a user can define 4 pixel points on screen, and what I would like to do is fill this shape with pixels using Unity's SetPixel.

While I can do this easily for square or rectangular shapes, I was wondering if there is any efficient code or algorithm to do this for more irregular four-sided shapes, such as trapezoids etc.

Note : Filling the shape with a mesh is not an option.

Any point inSo far the right direction would helpbest option I can think of is to draw the outline, then draw a line from each pixel point of every outline, to every other outline point, but for some reason I can't find anything useful through my searchesI'm not sure that's very efficient.

I'm developing an application in Unity3D where a user can define 4 pixel points on screen, and what I would like to do is fill this shape with pixels using Unity's SetPixel.

While I can do this easily for square or rectangular shapes, I was wondering if there is any efficient code or algorithm to do this for more irregular four-sided shapes, such as trapezoids etc.

Note : Filling the shape with a mesh is not an option.

Any point in the right direction would help, but for some reason I can't find anything useful through my searches.

I'm developing an application in Unity3D where a user can define 4 pixel points on screen, and what I would like to do is fill this shape with pixels using Unity's SetPixel.

While I can do this easily for square or rectangular shapes, I was wondering if there is any efficient code or algorithm to do this for more irregular four-sided shapes, such as trapezoids etc.

Note : Filling the shape with a mesh is not an option.

So far the best option I can think of is to draw the outline, then draw a line from each pixel point of every outline, to every other outline point, but I'm not sure that's very efficient.

added 58 characters in body
Source Link
Greg Quinn
  • 362
  • 1
  • 10

I'm developing an application in Unity3D where a user can define 4 pixel points on screen, and what I would like to do is fill this shape with pixels using Unity's SetPixel.

While I can do this easily for square or rectangular shapes, I was wondering if there is any efficient code or algorithm to do this for more irregular four-sided shapes, such as trapezoids etc.

Note : Filling the shape with a mesh is not an option.

Any point in the right direction would help, but for some reason I can't find anything useful through my searches.

I'm developing an application in Unity3D where a user can define 4 pixel points on screen, and what I would like to do is fill this shape with pixels using Unity's SetPixel.

While I can do this easily for square or rectangular shapes, I was wondering if there is any efficient code or algorithm to do this for more irregular four-sided shapes, such as trapezoids etc.

Any point in the right direction would help, but for some reason I can't find anything useful through my searches.

I'm developing an application in Unity3D where a user can define 4 pixel points on screen, and what I would like to do is fill this shape with pixels using Unity's SetPixel.

While I can do this easily for square or rectangular shapes, I was wondering if there is any efficient code or algorithm to do this for more irregular four-sided shapes, such as trapezoids etc.

Note : Filling the shape with a mesh is not an option.

Any point in the right direction would help, but for some reason I can't find anything useful through my searches.

Source Link
Greg Quinn
  • 362
  • 1
  • 10
Loading