Rendering triangle in 3d with texture? #1612
-
Hello. I have a simulated 3d world, in which ground is defined by triangles. I wanted to make a fast "3d preview" of it with Raylib, so naturally I would be using the DrawTriangle3D function to draw the ground, since it's made out of triangles. However I don't know how to make it have a texture. Is there a way to do it? Do I have to somehow convert the ground into a model and texture it? If it's possible, I would rather just slap a texture on a triangle. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@HoutarouOreki raylib does not provide any direct function to map a texture into a triangle. To accomplish that you should use |
Beta Was this translation helpful? Give feedback.
@HoutarouOreki raylib does not provide any direct function to map a texture into a triangle. To accomplish that you should use
rlgl
directly to define vertex position and texture coordinates assigned to every vertex. You can check shapes.c->DrawTriangle() for reference.