Questions tagged [mtl-file]

34 questions
9
votes
2 answers

Use ARCore with OBJ and MTL files

When played with the Android ARCore Samples, I noticed that the sample use the next line: mVirtualObject.createOnGlThread(this, "andy.obj", "andy.png"); andy.png is the PNG file texture to "stretch" over the andy.obj 3D object. I want to replace…
David
  • 37,109
  • 32
  • 120
  • 141
2
votes
1 answer

three.js - How to set custom color to *.obj model when it is delivered without *.mtl file?

I have a set of models in *.obj format that come without material files (*.mtl files). Some online services display these models correctly: https://3dviewer.net/, https://sketchfab.com/. But - according to the three.js documentation - in my project…
Vitaly Vesyolko
  • 558
  • 5
  • 22
2
votes
0 answers

Transparent png (alpha channel) support in obj's mtl file

I am scratching my head about this thing: I have simple model of LEGO tile 2x2 brick in OBJ file format in red color that has applied transparent image of yellow arrow to its top surface. It is defined in the mtl file like this (generated with…
qraqatit
  • 492
  • 4
  • 14
2
votes
0 answers

How to mix diffuse value (Kd) with texture (map_Kd) while loading wavefront file?

I'm just trying to write wavefront files loader in c++. I followed the tutorial at www.opengl-tutorial.org. It doesn't say how to handle mtl files, so I decided to do it myself. I know that Kd is responsible for the color of the diffuse property. On…
2
votes
0 answers

ThreeJS OBJLoader + MTLLoader - Model appearing black

I am having some troubles loading colors onto one of my models. I am using an OBJloader and an MTLloader. The .obj and .mtl files are generated from an export from blender (there is no texture which uses .png/.tga file). MTL files loads perfectly…
1
vote
0 answers

MTL file along with OBJ file for displaying 3D models in p5.js

I followed the example from p5.js Reference It contains an example of how to load an OBJ file in JavaScript with p5.js: //draw a spinning teapot let teapot; function preload() { // Load model with normalise parameter set to true teapot =…
1
vote
1 answer

SceneKit – How to apply MTL texture to OBJ file?

As a follow up to: ios - How to apply mtl texture file to OBJ I would like to add .MTL texture along with my .OBJ file, when importing my model to SceneKit using code like this: let scene = SCNScene(named: "rose.obj") BUT the texture file I have is…
user15526403
1
vote
1 answer

How to add a material (.mtl) to an object (.obj) using three.js?

I have successfully gotten a .obj file to display using three.js from a snippet of code I found online which I adapted for my needs. But am now trying to add the .mtl material file and am getting stuck. I've tried a few things but nothing seems to…
Kiki
  • 317
  • 1
  • 4
  • 18
1
vote
1 answer

How to add path to texture in OBJ or MTL file?

I have next problem: My project consists of .obj file, .mtl file and texture(.jpg). I need to divide texture into multiple files. But, when I do it, the UV coordinates (after mapping and reverse mapping) will be the same on several files, thus it…
Various
  • 11
  • 1
  • 2
1
vote
0 answers

object.traverse is not a function

I am trying to applying color on texture with opacity, but when i added some code for setting the color it shows error "Uncaught TypeError: object.traverse is not a function". Color code: objLoader.load( 'demo table/demo table.obj', function (…
user3578065
  • 31
  • 1
  • 6
1
vote
0 answers

mtl file missing map_kd

I'm using blender to export an obj file. The obj file works fine to me, however, the mtl file doesn't have map_kd for most materials. But there is an exception thought, only this one have map_kd: And here is what it looks like in my Blender:
Kevin Yang
  • 59
  • 9
0
votes
0 answers

showing black screen when rendering 3d model .obj file on webpage

I am trying to render 3d model .obj file on webpage using Three.js. I am not getting any error on console. But 3d model is not shown. I have tried previous related solutions but not worked for me.Like: Model not rendering on screen On rendering…
0
votes
1 answer

I use Acceleo to create Java main method, but "[]" causes trouble because Acceleo redeems this as invocation

I am using Acceleo to create Java main method in my ".mtl", like this [template public generateElement(aMiniFamily : MiniFamily)] [comment @main/] [file ('CreateMiniFamily.java', false, 'UTF-8')] public static void main(String[] args) { …
xy3333
  • 13
  • 3
0
votes
0 answers

C# HelixToolkit: ObjReader reading from stream returns transparent model

I wanna load .obj/.mtl models in C# using the HelixToolkit.ObjReader. The Read(string path) method works fine but the Read(Stream objStream, Stream[] mtlStreams) method sometimes returns a transparent model. But i need to use the stream reading as…
0
votes
0 answers

MTLLoader problem - object is black coloured

I'm having trouble loading textures. I've tried several ways but my object is still black. What am I doing wrong? const onProgress = function (xhr) { if (xhr.lengthComputable) { const percentComplete = (xhr.loaded / xhr.total) * 100; …
1
2 3