From f885f25bfb1e0d1dda1d175df3c7bf88f45fb104 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ni=C3=B1o=20D=C3=ADaz?= Date: Mon, 1 Jan 2024 03:50:16 +0100 Subject: [PATCH] tools: Clarify some comments --- tools/md5_to_dsma/md5_to_dsma.py | 3 ++- tools/obj2dl/obj2dl.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/md5_to_dsma/md5_to_dsma.py b/tools/md5_to_dsma/md5_to_dsma.py index 629b47c..6e8a220 100755 --- a/tools/md5_to_dsma/md5_to_dsma.py +++ b/tools/md5_to_dsma/md5_to_dsma.py @@ -666,7 +666,8 @@ def convert_md5mesh(model_file, name, output_folder, texture_size, # ------- st = vert.st - + # In the MD5 format (0, 0) is the top-left corner, same as what + # the GPU of the DS expects. u = st[0] * texture_size[0] v = st[1] * texture_size[1] dl.texcoord(u, v) diff --git a/tools/obj2dl/obj2dl.py b/tools/obj2dl/obj2dl.py index d89e945..6ac40e9 100755 --- a/tools/obj2dl/obj2dl.py +++ b/tools/obj2dl/obj2dl.py @@ -130,8 +130,8 @@ def convert_obj(input_file, output_file, texture_size, if texcoord_index is not None: u, v = texcoords[texcoord_index] - # On OBJ, (0, 0) is the bottom-left corner. On the DS, (0, 0) is - # the top left corner. This flips the top and the bottom. + # In the OBJ format (0, 0) is the bottom-left corner. In the DS, + # (0, 0) is the top left corner. We need tp flip top and bottom. v = 1.0 - v u *= texture_size[0] v *= texture_size[1]