Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Material loss #40

Open
lwh504530121 opened this issue Aug 24, 2024 · 3 comments
Open

Material loss #40

lwh504530121 opened this issue Aug 24, 2024 · 3 comments

Comments

@lwh504530121
Copy link

First of all thank you for open source! I encountered some problems in the process of using, I took the obj model input with material (.mtl) and simplified the output model without material, how do I associate the material back?

@neurolabusc
Copy link
Collaborator

I was able to simplify this obj file and view it with MeshLab. Note that the texture (.jpg) and material (.mtl) files are not changed, only a new obj file is created.

$ git clone [email protected]:sp4cerat/Fast-Quadric-Mesh-Simplification.git
$ cd Fast-Quadric-Mesh-Simplification/src.cmd
$ make
$ ./simplify ~/pineapple2/pineapple2.obj ~/pineapple2/pineapple23.obj 0.2
Mesh Simplification (C)2014 by Sven Forstmann in 2014, MIT License (64-bit)
loading obj
Input: 17169 vertices, 34271 triangles (target 6854)
iteration 0 - triangles 34271 threshold 2.187e-06
exporting obj
Output: 3449 vertices, 6854 triangles (0.199994 reduction; 0.0239 sec)
Screenshot 2024-08-24 at 9 15 40 AM Screenshot 2024-08-24 at 9 16 27 AM

@lwh504530121
Copy link
Author

我能够简化这个obj 文件并使用 MeshLab 查看它。请注意,纹理 (.jpg) 和材质 (.mtl) 文件没有更改,只创建了一个新的 obj 文件。

$ git clone [email protected]:sp4cerat/Fast-Quadric-Mesh-Simplification.git
$ cd Fast-Quadric-Mesh-Simplification/src.cmd
$ make
$ ./simplify ~/pineapple2/pineapple2.obj ~/pineapple2/pineapple23.obj 0.2
Mesh Simplification (C)2014 by Sven Forstmann in 2014, MIT License (64-bit)
loading obj
Input: 17169 vertices, 34271 triangles (target 6854)
iteration 0 - triangles 34271 threshold 2.187e-06
exporting obj
Output: 3449 vertices, 6854 triangles (0.199994 reduction; 0.0239 sec)

截图于 2024-08-24 上午 9 15 40 截图于 2024-08-24 上午 9 16 27

image
image
The texture photos and materials were associated in the obj file via mtllib xxxx.mtl and usemtl xxx, and the obj file was lost after simplify output

@neurolabusc
Copy link
Collaborator

I am unable to replicate with the sample image, version and compilation I provide above. As you can see, the material file is retained for the pineapple. It is unclear if the difference reflects the file you are converting or the version of this software you are using. You can trouble shoot this by following the recipe I provide above. If the software works for the pineapple, but not with your mesh, you will need to share a copy of your mesh to allow replication of the issue.

simplify

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants