Questions tagged [objloader]

75 questions
0
votes
0 answers

MTLLoader doesn't show texture on the object I load

I'm new to ThreeJS, still learning. I have like an earth globe 3d object that I load into my scene, and I also have a mtl file which I load according to the documentation, but after I render the scene the globe still looks without texture. I think…
Chriss
  • 323
  • 1
  • 2
  • 10
0
votes
1 answer

Three.js - exporting scene with TextGeometry to OBJ/GLTF then load by OBJ/GLTF Loader

I have problem with import/export scenes in Three.js I have few objects (models loaded with OBJLoader, Text generated with TextGeometry). Im able to export it to string definition using OBjExporter/GLTFExporter, but when Im trying to load it again,…
0
votes
0 answers

three.js getObjectByName() results in undefined

I am attempting to change the opacity of an object in the update function but I am not able to call on the object by name. It always returns undefined. This code is a fragment. There are many cars using the same function. I commented, "IS THIS…
Alex Brandt
  • 73
  • 1
  • 1
  • 6
0
votes
1 answer

Cant seem to add my obj to the scene: THREE.Object3D.add: object not an instance of THREE.Object3D

I am new to using three.js. I used to use a JSON file as my 3D model but the actual 3D file has some issues when I export it from Blender so I am switching to obj. The actual model is fine now but I have no idea how to switch from JSON to obj. This…
TahaInc
  • 45
  • 1
  • 6
0
votes
0 answers

Apply MeshLambertMaterial on OBJLoader2 loaded mesh

I have an obj file that I display with OBJloader2. I am looking for a way to apply a MeshLambertMaterial on it. I can do that with OBJLoader, with the following code called in the onLoadedCallback function : material = new…
Thibault
  • 1
  • 3
0
votes
1 answer

Three JS OBJloader - obj not importing properly

i'm trying to import an obj with OBJLoader but it isn't importing properly The obj is like this - Obj img And it's importing this - Obj in three js What happens is that the whole obj isn't importing well. What can i do about it ? The code that i'm…
0
votes
1 answer

THREE.js - vertex's coordinates of BufferGeometry (ObjLoader)

I'm new to Three.js, and have an issue with getting coordinates of 2 verticies. I need their x,y,z coordinates to calculate and draw sizes. I used ObjLoader and I know exactly ID's (indexes) of verticies - 11889 and 11877. I tried to use some…
flay_x
  • 3
  • 2
0
votes
1 answer

THREE.OBJLoader - Scale mesh and BufferGeometry vertices

I'm using THREE.OBJLoader to load a 3D model into my scene. It works fine. However, after adding it to the scene, I need to scale it by 10, then retrieve its vertices position. I know that THREE.OBJLoader gives me a BufferGeometry, and I know how to…
Keysaw
  • 227
  • 4
  • 19
0
votes
1 answer

How can I load a group of objects to a global variable with OBJLoader without type-error messages?

I'm using the following code to load OBJ objects, but in order to load the resulted group on a global variable, I pre-define the variable as 'null' which raises Type-error messages in Firefox console. I tried defining it as THREE.Group, THREE.Mesh,…
user5515
  • 301
  • 2
  • 18
0
votes
1 answer

How to load .obj models into objects on three.js for mobile performance

How should I load .obj models with objLoader and MTLLoader properly? Im asking this question because my three.js mini game consist of a few obj and mtl models that are being loaded before starting my space games animation loop begins. The game…
sirshakir
  • 129
  • 4
  • 13
0
votes
1 answer

objloader not loading material

I'm working with Three.js. I have loaded a obj object into my scene. The object loads but the MTLLoader is not providing the materials. Is my object broken? Is it the MTL Files? This code adds my spaceship OBJ const name =…
sirshakir
  • 129
  • 4
  • 13
0
votes
0 answers

Object loaded with ObjLoader does not receive shadows in three.js

The model casts shadows on a ground-plane but it does NOT receive shadows from another small plane in front (which does cast shadows on the ground-plane), let alone from itself. Any ideas ??? var light = new THREE.DirectionalLight( 0xffefee, 1.2…
user5515
  • 301
  • 2
  • 18
0
votes
0 answers

how to use multiple texture objLoader, mtlLoader in three.js?

I can able to visible object but don't work multiple material textures images. It's visible black color. what is missing in my code? case 'plant': var mtlLoader = new THREE.MTLLoader(); mtlLoader.setPath('models/LivingRoom/Sample1/'); …
karthick187
  • 61
  • 13
0
votes
1 answer

How to multiple textures from mtlLoader and objLoader using in three.js?

I have .mtl,.obj and multiple textures .jpg file. I tried to use different textures in export loader obj. I am able to make my object visible on the scene but my object black colour visible. Any idea on what is wrong/is missing in my code? var…
karthick187
  • 61
  • 13
0
votes
1 answer

How to find three.js import `.obj` original width and height?

I am the beginner in Three.js. I import three.js .obj file using the visible 3D object. How to find this .obj object original width and height?
user8203652