Ravindu89 Posted September 6, 2018 Share Posted September 6, 2018 I have to make a chart that fills the area between two lines looks like in below. I have calculated and drawn two lines and connected each lines (See below image) And I have used 2 approaches to complete this task. drawPolygon Using color for beginFill and both time I have failed. (See in below) Please advice me. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted September 6, 2018 Share Posted September 6, 2018 The result will differ for 2d and webgl. Pixi WebGL Graphics uses "earcut" library to triangulate it, while 2d Graphics uses HTMLCanvasRendering2D Context, and whatever triangulation is inside. You have to change earcut to something else, or do triangulation manually, which is easier condiering your input. You can even use Mesh instead of Graphics. Quote Link to comment Share on other sites More sharing options...
Wilco93 Posted September 7, 2018 Share Posted September 7, 2018 This seems like the perfect job for a fragment shader. While I do not have the time right now to write it for you, I am sure someone here can help you out. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.