-
-
Notifications
You must be signed in to change notification settings - Fork 29
Adding .OBJ Objects with UV Maps
Object .OBJ files can be manually created but must be a triangulated mesh, not a polygonal mesh. Triangles that share vertices should be properly linked within the object file to save on memory space as the memory is shared between triangles.
Here is an example of a single right-triangle:
v -50.000000 -50.000000 0.000000
v -50.000000 50.000000 0.000000
v 50.000000 -50.000000 0.000000
f 3 2 1
Here is an example of a single right-triangle with a UV Map:
v -50.000000 -50.000000 0.000000
v -50.000000 50.000000 0.000000
v 50.000000 -50.000000 0.000000
vt 0.000 0.000
vt 0.000 1.000
vt 1.000 1.000
f 3 2 1
To create a ProtoTracer Object3D from an ASCII .OBJ file, open the ProtoTracerOBJConverter project. Modify the top few lines to fit your input file, your UV mapped material if in use, the output C++ file name, and the class name:
fileName = "Example Files\Bee\Bee.obj"
textureName = "Example Files\Bee\Bee.png"
outputCPPName = "Output\Bee.h"
name = "Bee"
Run the python file to create the C++ output header. This file can now be included and directly used similarly to the example in the Creating an Animation example.
Any recommendations on additional information to add can be requested in the discussions tab. If you have additional questions, you can @ me in my Discord server or on direct message me on Twitter.