Might sound like a stupid question but I am not succeeding in pre-loading the OBJ file for Javascript to display the object.
So I was thinking about converting the "box.obj" file into vertices/polygons etc. and building the object as normal in processing.. that way, I will not have to battle with the preload method in processing.js
I converted parts of the
OBJ
to vertices but it does not show the complete object yet.
Is there any way of letting loadShape("box.obj") do it's magic and obtain it's actual converted result?
Here is the test object file for reference:
- v -14.2585 -6.0209 15.4785
- v -14.2585 -6.0209 -12.8278
- v 21.4724 -6.0209 -12.8278
- v 21.4724 -6.0209 15.4785
- v -14.2585 5.5800 15.4785
- v 21.4724 5.5800 15.4785
- v 21.4724 5.5800 -12.8278
- v -14.2585 5.5800 -12.8278
- # 8 vertices
- vn 0.0000 -1.0000 -0.0000
- vn 0.0000 1.0000 -0.0000
- vn 0.0000 0.0000 1.0000
- vn 1.0000 0.0000 -0.0000
- vn 0.0000 0.0000 -1.0000
- vn -1.0000 0.0000 -0.0000
- # 6 vertex normals
- g Box001
- f 1//1 2//1 3//1 4//1
- f 5//2 6//2 7//2 8//2
- f 1//3 4//3 6//3 5//3
- f 4//4 3//4 7//4 6//4
- f 3//5 2//5 8//5 7//5
- f 2//6 1//6 5//6 8//6
- # 6 polygons
The problem is that I do not know how to convert this OBJ file into plain vertices.
Any ideas?
1