You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to define a custom @ti.dataclass and render it with textures, how can I do that?
Specifically, I have an image and want to use it as the texture for my custom dataclass. I am not sure how can I render an image on the canvas. canvas.set_image() will set the image to the entire canvas, while canvas.triangles() only supports meshes...
Another compromise is to a set of particles to represent my dataclass, but then the question rises again as to how can I store a list of vectors inside a dataclass. Usually I would declare a variable like v : vec3, but I am not sure how to do that with lists or fields.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I want to define a custom @ti.dataclass and render it with textures, how can I do that?
Specifically, I have an image and want to use it as the texture for my custom dataclass. I am not sure how can I render an image on the canvas. canvas.set_image() will set the image to the entire canvas, while canvas.triangles() only supports meshes...
Another compromise is to a set of particles to represent my dataclass, but then the question rises again as to how can I store a list of vectors inside a dataclass. Usually I would declare a variable like v : vec3, but I am not sure how to do that with lists or fields.
Beta Was this translation helpful? Give feedback.
All reactions