how to draw a nice mesh

168 views
Skip to first unread message

Dave M

unread,
Dec 2, 2021, 5:51:11 AM12/2/21
to skia-discuss
hello every one, i have problem with  drawVertices ,i have a segy section data as below
boo.png
gridding mesh make trips,each point with a color then i use  drawVertices code:
SkPaint filPaint;
filPaint.setAntiAlias(true);
filPaint.setStyle(SkPaint::kFill_Style);
float spaced = 200.0;
SkPoint testPts[6] = { SkPoint::Make(0, 0), SkPoint::Make(spaced, 0),
SkPoint::Make(0, spaced), SkPoint::Make(spaced, spaced),
SkPoint::Make(0, spaced * 2), SkPoint::Make(spaced, spaced * 2) };

SkColor colors[6] = { SK_ColorGREEN, SK_ColorRED, SK_ColorYELLOW, SK_ColorBLUE, SK_ColorGREEN, SK_ColorRED };
canvas->drawVertices(SkCanvas::kTriangleStrip_VertexMode, 6, &testPts[0], nullptr, &colors[0], nullptr, nullptr, 0, filPaint);

截图20211202173717.png
 which i supposed to be good.png

then i use VTK to render same data  firstly it do same thing like skia,but with vtkMapper::SetInterpolateScalarsBeforeMapping set flag true, i get it.

i want know how can i do it with skia ?

asdfg...@gmail.com

unread,
Dec 5, 2021, 10:15:22 PM12/5/21
to skia-discuss
I got the same issue, anyone can help?
Reply all
Reply to author
Forward
0 new messages