mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-22 02:11:19 +00:00
Reveres the face windings.
Blender's vertex order and quake's vertex order seem to be opposed.
This commit is contained in:
parent
0569e0ebd3
commit
11f37298be
1 changed files with 4 additions and 1 deletions
|
@ -175,7 +175,9 @@ def make_faces(mdl):
|
|||
faces = []
|
||||
uvs = []
|
||||
for tri in mdl.tris:
|
||||
faces.append (tri.verts)
|
||||
tv = tri.verts
|
||||
tv = tv[2], tv[1], tv[0] # flip the normal by reversing the winding
|
||||
faces.append (tv)
|
||||
sts = []
|
||||
for v in tri.verts:
|
||||
stv = mdl.stverts[v]
|
||||
|
@ -186,6 +188,7 @@ def make_faces(mdl):
|
|||
# quake textures are top to bottom, but blender images
|
||||
# are bottom to top
|
||||
sts.append((s * 1.0 / mdl.skinwidth, 1 - t * 1.0 / mdl.skinheight))
|
||||
sts = sts[2], sts[1], sts[0] # to match face vert reversal
|
||||
uvs.append(sts)
|
||||
return faces, uvs
|
||||
|
||||
|
|
Loading…
Reference in a new issue