파이썬[Python]: kivy - Mesh 클래스
kivy.graphics 모듈 - Mesh 클래스(class)
/// 설명
Mesh(Polygon Mesh)
참고: graphics 모듈 목록
※ 형식
Mesh(**kwargs)
reference
https://kivy.org/doc/stable/api-kivy.graphics.html
참고: graphics 모듈 목록
※ 형식
Mesh(**kwargs)
reference
https://kivy.org/doc/stable/api-kivy.graphics.html
/// 예제
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | import kivy kivy.require('2.0.0') from kivy.app import App from kivy.core.window import Window from kivy.uix.widget import Widget from kivy.graphics import Mesh Window.clearcolor = (.5, .0, .5, .1) Window.size = (563, 1001) Window.top, Window.left = 30, 800 class TestApp(App): def build(self): w = Widget() # ______________ ______________ # using canvas[x1, y1, u1, v1, x2, y2, u2, v2 ......] v_list = [10, 400, 0, 0] v_list.extend([120, 600, 0, 0]) v_list.extend([200, 550, 0, 0]) v_list.extend([320, 550, 0, 0]) v_list.extend([400, 370, 0, 0]) v_list.extend([550, 520, 0, 0]) v_list.extend([520, 800, 0, 0]) i_list = [0, 1, 2, 3, 4, 5, 6] ms = Mesh(vertices=v_list, indices=i_list, mode='line_strip') w.canvas.add(ms) return w TestApp().run() | cs |
/// 출력
* 실행환경: Microsoft Windows 10 Homes
* 인터프리터: 파이썬(Python 3.9)
– 당신을 응원합니다. –
댓글
댓글 쓰기