Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Mesh to PLY Creator

edited November 2012 in Code Sharing Posts: 666

Ever wanted to archive off all of those mesh files, or grab one from memory to read later? Now you can!

I have written a basic mesh() save routine to archive to PLY files. Please note that I am NOT saving textures nor texturecoordinates with this version.

I've placed in it this gist: https://gist.github.com/4114671 . Adding texturecoord stuff is not critical, but can be done if there's people looking for it.

Tagged:

Comments

  • Jmv38Jmv38 Mod
    Posts: 3,295

    Hello @aciolino, thanks for sharing. How do you read back the mesh?

  • Posts: 666

    Lol - I need to publish the HTTPLoader project - that reads X3D and PLY.

  • edited November 2012 Posts: 666

    @Jvm38, I added a hacked version of ReadPLY.lua to the gist; I commented out various HTTPLoader specific areas so that you can use it to read a PLY file. I also added a sample .PLY file, a 1 unit cube.

  • Jmv38Jmv38 Mod
    Posts: 3,295

    Thanks @Aciolino. I grabbed the code and example, but since it needs some coding on my side (write a 'main', load a text file - i've never done it) i have not been able to see it work. However its good to see an example of code doing this. I'm working on saving my mesh into an image (including the texture image) because then everything will be packed in the same object, but it takes quite some time to put everything together. And also, at work i am entering a 'heavy duty coding' phase, so i must rest a little bit when i'm at home...

  • edited November 2012 Posts: 666

    So...I think that I can accelerate your process...as far as saving texture information I think I will modify the writer to do so today.

    For now, save the PLY file in your DropBox public folder, if you have one.

    I have a large project called HTTPLoader that I really want to rename and clean up , but it would solve your needs. Te only reason I haven't published it yet is because I want some decent source control on it - and fists aren't good enough for that to me. But its helpful, so I'll work on publishing it and writing up a walk through. It takes 5 minutes to get an object loaded and rendered.

  • Posts: 666

    Oops - didn't write the texture stuff yet :) Not quite sure how easy it is to extract texCoords or texture file names.

  • Jmv38Jmv38 Mod
    Posts: 3,295

    Bah, don't worry, i'am almost done on my side. Thanks anyway. Btw, what do you mean by 'it takes 5 minutes'? Why is it that long? Loading a big image is only 10 s, so i don't expect an object loading to be longer?

  • Posts: 666

    5 minutes of software development, not object loading time :)

  • Posts: 666

    Finished writing the texture stuff on mine a few days back.

  • Jmv38Jmv38 Mod
    Posts: 3,295

    Have you seen my post on mesh saving to an image? What do you think about this solution?

  • Posts: 666

    I haven't looked at it yet, but I will!

Sign In or Register to comment.