The VVS (Vertice Vector sorted) file format is an outdated file format. VVS are specialized for storing triangular file data for 3D models, the file are highly inefficient for space, but are simple to utilize in scripting.
VVS files can only store triangular face data in sets of 3 points, with each point made os their X,Y,Z positions.
The only known way to convert a 3D model to a VVS is to use the .obj to .vvs. The converter provided runs in Python (Press arrow to view)
# ---------- CONFIG ----------
INPUT_OBJ = "toConvert.obj"
OUTPUT_VVS = "converted.vvs"
# ----------------------------
vertices = []
faces = []
# Read OBJ file
with open(INPUT_OBJ, "r") as f:
for line in f:
# Vertex
if line.startswith("v "):
_, x, y, z = line.split()
vertices.append((float(x), float(y), float(z)))
# Face
elif line.startswith("f "):
parts = line.split()[1:]
# Only triangles
if len(parts) == 3:
face = []
for p in parts:
# Handles formats like:
# f 1 2 3
# f 1/2/3 4/5/6 7/8/9
vi = int(p.split("/")[0]) - 1
face.append(vi)
faces.append(face)
# Find minimum coordinates
min_x = min(v[0] for v in vertices)
min_y = min(v[1] for v in vertices)
min_z = min(v[2] for v in vertices)
print("Minimums:", min_x, min_y, min_z)
# Offset negatives so everything becomes positive
off_x = -min_x if min_x < 0 else 0
off_y = -min_y if min_y < 0 else 0
off_z = -min_z if min_z < 0 else 0
# Write VVS file
with open(OUTPUT_VVS, "w") as out:
for face in faces:
for vi in face:
x, y, z = vertices[vi]
x += off_x
y += off_y
z += off_z
# Write only XYZ
out.write(
f"{round(x,3)} "
f"{round(y,3)} "
f"{round(z,3)} "
)
print("Done! Saved to", OUTPUT_VVS)
To use the convert, make sure the obj file is named "toConvert" and is located in the same file as the python script. The out putted vvs can be opened in Notepad.