-
|
Hi everyone, I started using Pythonista 3 just a couple of days ago, and I'm completely noobie. How to use the triangle_strip? I can’t understand the documentation with this function |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
@zaival It’s looking for a call like: points=[
(x1,y1),
(x2,y2),
(x3,y3)
]
scene_drawing.triangle_strip(points)Where x1 y1 to x3 y3 are 2d vectors specifying each point of a triangle, you can pass it multiple triangles to be drawn from one list. Each triangle must be three points following either in a clockwise or anticlockwise direction depending on which way the function expects (it’s not stated here however). It can also map another image onto these triangles with a second set of 3 point triangles called uv’s which correspond to each of the triangle points in mapping positions from an image instead. This is more complicated though so if you’re a beginner I’d suggest focusing on just drawing the one or two triangles first with a solid fill colour without the extra complication of uvs and mapping a texture (image) onto the triangle as well. To clarify the triangle points a bit further x is a number representing a horizontal position of the point, y is number representing a vertical position of the point. A full set could be: points= [
(0,0),
(0,5),
(5,0),
] |
Beta Was this translation helpful? Give feedback.


@zaival It’s looking for a call like:
Where x1 y1 to x3 y3 are 2d vectors specifying each point of a triangle, you can pass it multiple triangles to be drawn from one list. Each triangle must be three points following either in a clockwise or anticlockwise direction depending on which way the function expects (it’s not stated here however). It can also map another image onto these triangles with a second set of 3 point triangles called uv’s which correspond to each of the triangle points in mapping positions from an image instead. This is more complicated though so if you’re a beginner I’d suggest focusing on just …