Texturing Models

I encoded a 3d-terrain engine with a simplified model engine on it.

I use a rectangular elevation map for my terrain, so texturing these triangles is pretty simple.

However, when texturing my model, I got a little stuck.

I use a custom model format, so answers like using a blender or using 3ds will not be useful.

The reason for this is that I started this hobby project to teach OpenGL programming, and since I had models ready for the really old Turbo Pascal software rendering that my friend wrote in 1999, I just kept using them.

My questions:

Is there a known algorithm for creating texture coordinates for the triangles that make up my model? If not, what strategy should I follow?

+3
source share
2 answers

There are several ways to automatically create texture coordinates, but I don’t know what an easy way to do this, which will give you the coordinates without significant distortion or excessive gaps.

, - , . , XNA .x . , , , , , , 3D-.

, , - - , . - - "" "", , .

, , , x y , , , .

, . . , , , UV-, , Blender ..

+4

Blender . 100 Python ( ), uv- , 2x 100 LOC

- .obj( -), .

+1

Source: https://habr.com/ru/post/1757311/


All Articles