Closed sarangzambare closed 3 years ago
Hi Sarang,
Can you share the mesh? I can have a look at it.
I just have tried with the attached obj file containing mesh with no stored normals and this example, loading the mesh with both load_mesh_obj()
and load_merged_mesh_obj()
functions, and make_normals
seems working.
Maybe faces in your mesh are not sharing vertices?
You can also inspect what exactly is stored in the vertex, normals, etc buffers: see this example and docs (this API is evolving, but already quite usable).
Hi,
This is weird, with the teapot obj file that you linked, the make_normals seems to be working. However it does not work with my Desk.obj file, I am attaching the file here.
Some differences that I see between my obj file and the teapot one are :
In Desk.obj the faces are given in the format = v_index/vt_index/vn_index In teapot obj file the faces are given in the format = v_index only
e.g f 1/1/1 4/4/4 2/2/2
vs f 1 5 6
The teapot obj file has an s off
flag in it just before starting the faces
I am now trying to further inspect the objects using the PinnedBuffer API that you linked earlier, but please let me know if my Desk.obj file works for you.
The difference in face format is because there are no normals and no uv mapping in the file I have sent.
Normals in your file look correct if I load it into Blender. Later today I'll try to understand what is going on.
If I remove normals from Desk.obj
, and re-calculate them with make_normals=True
, then the mesh looks correct. The file is attached.
desk_no_normals.zip
I also tried removing uv's and export only positions and normals to obj - I think there is a bug in loading obj with this combination.
I'll let you know when I find fixes.
OK, I checked the loading code and it is correct. So also in the case when uv's are not present everything is OK.
Loading the obj file works in the way that if there are normals present in the file already, it does not re-calculate them, even if make_normals=True
.
I took a closer look at the normals in your file using Blender. Looks like they are all OK, but shading is a bit strange. So I did "reset vectors", which helped, and exported such file. Then in plotoptix things look OK as well.
I don't know what was the problem with normals. Vectors didn't move visually when I reset them.
Corrected obj attached.
Hi,
That's interesting and weird haha. I also tried removing all the normals from the obj file and the make_normals=True did make a difference but the smoothening was not very fine (I could still see jagged lines, just not as much as with normals).
Thanks for trying out Blender and attaching the file. I will perhaps add that step into my pipeline as well.
I think the best course of action from this issue would be to update the documentation regarding make_normals ? Thanks anyway! :)
closing this issue.
make_normals=True calculates normals only when no normals are provided in the OBJ file.
Yes, I'll add that to docs, thanks!
Hi!
First of all amazing work making this library! :)
I am trying to load an obj file using
load_merged_mesh_obj
. My obj file is Desk, and the legs of the desk are cylindrical.I tried loading the obj file in three ways:
make_normals = True
make_normals = False
update_mesh
However, I observe no change in the way the object is rendered, the legs of the desk still look jagged. Attaching pictures from the three cases:
case1:
case2:
case3:
My questions are:
Thanks! :) Here's my source code: