lukasHoel / text2room

Text2Room generates textured 3D meshes from a given text prompt using 2D text-to-image models (ICCV2023).
https://lukashoel.github.io/text-to-room/
MIT License
1.02k stars 71 forks source link

How can i use the output .ply files on Unity with textures? #29

Closed Jacky-MYQ closed 1 year ago

Jacky-MYQ commented 1 year ago

Dear Lukas, I sincerely appreciate it that you can answer my plain questions patiently. Now, I have another question that though i successfully got a geometry with textures in Meshlab, i actually want to open ply files in the Unity and it just displays a gray geometry again. Because ply files can not import in Unity directly, I change ply format into fbx format and obj format but it doesn't work. It is also just a gray geometry without any textures. I try to use many methods as they said in Google but it doesn't work. So I have to ask you to obtain some solutions. I would like to kown whether you have any solutions. If you can do me a favor, I am sincerely grateful to you again!!!

lukasHoel commented 1 year ago

Unfortunately I do not have experience with Unity, but there must be a solution for sure... ^^ sorry, can't help with this

Jacky-MYQ commented 1 year ago

Luckily, I used Point Cloud Free Viewer which is in Unity Assets store to succeefully open the file of .off format with textures(I use Meshlab to change .ply format into .off format ). My step is as follow: First, I download Point Cloud Free Viewer in Unity Hub. Then you need to open Unity , click "Window"->"Package Manager", import Point Cloud Free Viewer. Scendly, you need to add "EnablePointSize.cs" to "Main Camera" as a componet. Then create a new "GameObject" and add "PointCloudManager.cs" to "GameObject" as a componet too. (This step may occur an error which may say "Can't add script component ..... because script class cannot be found. Make sure that ...... " My solution is that i reopen the Unity and it will put a small window which basically means to update something. I clicked "yes" and then the error disappeared. ) Thirdly, in your "Point Cloud Manager" componet, amend "Data Path" using your .off file path and select "VertexColor" in "Mat Vertex". Then click run button and you will see your geometry with textures. Hoping this will help you guys!