I would really like to deploy my textured 3D graphics in the web with sketchfab in my blog. Unfortunately, Mathematica only exports the shape of the 3d graphics, i.e. the .obj file, but omits the associated material file (.mtl) which is not generated.

Is there any way to accomplish my aim and deploy from Mathematica textured-graphics to sketchfab or any other standard textured material format? Perhaps someone has written a basic .mtl exporter?

  • $\begingroup$ Sketchfab supported formats: sketchfab.com/faq/upload#which-formats-are-supported. Mathematica 3D file formats: reference.wolfram.com/language/guide/…. Is there something you can use there? For example .3DS is supported in both $\endgroup$ – dr.blochwave Aug 23 '14 at 21:19
  • 1
    $\begingroup$ @blochwave Thanks for the comment. Yes I had already check that out. Supported model files include .3ds, .obj, .dae, .blend... But to add texture, Sketchfab requires a zip file combining both Model file AND Materials (.mtl), hence the .mtl file is required, without it there will be no rendered textures :( $\endgroup$ – user5601 Aug 26 '14 at 3:16
  • 1
    $\begingroup$ I will note that unless the user specifies a texture using something like PlotStyle->ExampleData[{"ColorTexture", "WhiteMarble"}], it seems like Mathematica will create both of these files. However, if a texture is specified, it will only create the .obj file. (See documentation for obj format, including working examples. This is v10, not sure if same for v9.) $\endgroup$ – Kellen Myers Aug 26 '14 at 17:06
  • 1
    $\begingroup$ Great question! Shouldn't be hard to write an exporter, the file format specification is simple enough: web.cse.ohio-state.edu/~hwshen/581/Site/Lab3_files/… $\endgroup$ – M.R. Aug 28 '14 at 16:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.