min3d loading objects with just colors no texture imgs. color wont load - min3d

I am trying to load my 3D object in android . i tried mat-d's tutorial and it worked. now I am trying to load other object (example a cake with color) that has no image textures. the problem is the object will load but the color will not

You mentioned in your question that you don't have an image texture which i am guessing as the mtl file. In min3d you need to put in both the obj file as well as the mtl file in order to load the object correctly. So either you will have to create an mtl file or download another sample which has an mtl file.
I have followed the example from mat-d's tutorial and was able to load obj files correctly. Also make sure that you put the jpeg file in the drawable folder and set the path in mtl file correctly.

Related

Conversion of .dae to .glb / .gltf

I am having success converting .usdz models to .dae using Xcode. However I eventually want the file formats to end up as .glb / .gltf.
I'm using blender to encode .dae into .glb, also a tool made by Khronos group here. https://github.com/KhronosGroup/COLLADA2GLTF
The problem is that the Xcode .dae output is a .dae file and a folder of .png texture files. Xcode can read this just fine and reconstitute the original .dae however blender seems to be incapable of using these texture files and same with the Khronos CLI converter. Using these tools, the .dae shows up without textures, colorless and only constituted in shape based on 3D coordinates.
Does anybody know how to use this folder of texture .png files to render color to a blender .dae?
Ultimately I want to convert .usdz to .glb / .gltf and this is the way I have found, but I'm running into this hiccup. Google search did not improve the hiccup, hence my question here.
I've been experimenting and have found another way you can possibly do the conversion to GLB outside of Blender. Basically, as you have found you convert the .usdz to .dae using Xcode - which results in a .dae file with a folder of textures (.png's). If you now zip the file and the folder together - rename the .zip file ending to .zae. Now take this .zae zip file and go to https://products.aspose.app/3d/conversion you can convert the zip file to GLB. Once you have the GLB file, test it out in Scene Viewer and you should now have the colours, textures etc. on the model. I have had a few issues on one model, namely not all the textures seem to be there, majority are but a few more detailed elements are missing. ie. I have a 3D Framed Artwork model, the black shiny frame, the brown paper backing, and the art colour background are fine but the details of the artwork are missing! Very weird. The Artwork itself is just in one texture file as a .png together with the other files for metallic, colours, etc. and it shows correctly in photoshop or viewer. Also the DAE file shows correctly in preview. Just when it's all brought together in GLB it is missing some detail. Kind of 80% sorted though. Hope this is of help!! And I also hope I have saved another fellow human being from tearing out the remainder of their hair...lol

Blender adding image / texture on object does not show up in .obj document

I've watched some tutorials on how to add images to an object in blender. There are different ways to do it but I choose to do it as the following: with UV image editor and making a material and after that a texture for the image.
This is how it looks in blender as rendered, the front and back view:
I need this blender project to be exported to a .obj file so I can use it for an AR project in ENTiTi, but no matter what I Do, the rectangle will be empty when exported to .obj
Material and texture preview:
Can you guys please help me because I can't find a solution on google or youtube. I made a **google drive directory with the blender file, .obj file and the images:
https://drive.google.com/drive/folders/1WdspdKiK28vTmJVepi_FWb4Avs1pZOw5?usp=sharing**
Thanks a lot !
.obj format do not export the texture applied to the model, it should export the materials and texture in an .mtl file. You would need to apply the .mtl file to your .obj inside your development environment.
However, you could try to export to .fbx. I tried exporting your object to .fbx, for the reimporting to blender. Then the texture was applied correctly. ENTiTi has support for .fbx, so it should be worth a try
https://docs.blender.org/manual/en/latest/addons/io_obj.html
obj format do not export the texture applied to the model, it should export the materials and texture in an .mtl file. You would need to apply the .mtl file to your .obj inside your development environment.

Render 3d .obj file to .png image

Is there at least some way to get a picture of a .obj model without displaying the model ?
I have a lot of .obj models and I need to convert them to .png images.
I need only image without display anything
You don't really need libgdx for obj rendering. This can be done by either opengl, or some custom render libs.
Consider using this library written in c++ for obj rendering. Here's its description in russian
Do you need to do this in libgdx? I think you can also call blender via command line, let it render the scene and output to an image. Make a short bash script to do this for all .obj files in your folder.
If you do need to use libgdx, I think a good approach is to render to a framebuffer, then write its contents to a file.

WebGL importing models using the OBJMTLoader in three.js fails

I am having some problems trying to import the following model into WebGL using three.js:
http://tf3dm.com/3d-model/vanille-99084.html
I've converted the obj file to JSON using the converter that comes with three.js and the model works fine when using the JSON Loader. However, when trying to load the model with the textures from the .mtl file the OBJMTLOader fails.
I am using the following example and just replaced the paths with the paths to my files:
https://github.com/mrdoob/three.js/blob/master/examples/webgl_loader_obj_mtl.html
UPDATE:
I've made a bit of progress. For some reason I thought that I need to import the JSON converted OBJ rather than the obj file itself. So now that I've referenced the correct .obj file the model is imported correctly. However, the textures are still not loaded. Currently the whole model/mesh is just black.
Any help appreciated
It appears that the problem was due to the .TGA files comming with the models. Apparently, threejs can't parse TGA files. So the solution was to convert the TGA files to plain PNGs using Photoshop and then update the .mtl file to reference the PNGs rather than the TGA files.
There is a TGA Loader as well however if you don't want to do TGA to PNG conversion.
var texture = loader.load( 'textures/crate_color8.tga' );
var material = new THREE.MeshPhongMaterial( { color: 0xffffff, map: texture } );
var mesh = new THREE.Mesh( geometry, material );
From
http://threejs.org/examples/webgl_materials_texture_tga.html

How do I generate mipmap .png and model .obj files for LibGDX?

I'm playing a bit with LibGDX (OpenGL ES 2.0 wrapper for Android).
I found some sample code which used prepared files to load models and mipmap textures for them, e.g., at https://github.com/libgdx/libgdx/blob/master/demos/invaders/gdx-invaders/src/com/badlogic/gdxinvaders/RendererGL20.java it reads .obj file for the model and RGB565 format .png file to apply a mipmapped texture to it.
What is the best / easiest way for me to create these files?
I understand .obj files are generated by a bunch of tools (I installed Blender, Wings3D and Kerkythea so far), but which ones will be the most user friendly for someone unfamiliar with 3D modelling?
But more importantly, how do I produce a .png file with the mipmapped texture? The .png I looked at ( https://github.com/libgdx/libgdx/blob/master/demos/invaders/gdx-invaders/data/ship.png ) seems to include different textures for each of the faces, probably created with some tool. I browsed through the menus for the 3 tools I have installed but didn't find an option to export such a .png file. What am I missing?

Resources