flutter_cube icon indicating copy to clipboard operation
flutter_cube copied to clipboard

coudn't load my own .obj file

Open exmlcxjv opened this issue 5 years ago • 13 comments

Hi , I've put my own obj file into assets folder and try to load it but couldnt work, is there a guide on how to do it?

exmlcxjv avatar Apr 16 '20 08:04 exmlcxjv

Can you email the obj file to me?

zesage avatar Apr 16 '20 11:04 zesage

Can you email the obj file to me?

thank you , i've sent to your email

exmlcxjv avatar Apr 17 '20 01:04 exmlcxjv

Hey @zesage,

I have similar issue I can't load any model from poly.google this one for example https://poly.google.com/view/0ao4tHskrbu

I used the cube example as starting point and I was able to load the .obj file without materials (it renders as a white blank model) but when I add .mtl and a .png in folder it doesn't work (no errors but can't see the model). I'll be very grateful if you look at this issue, thanks a lot!

ilyaviache avatar May 16 '20 13:05 ilyaviache

fix in the last commit babfc628db9dae9138b5971aaf46a2bd45d2b44d

example code:

  scene.camera.position.setFrom(Vector3(0, 0, 10));
  scene.light.position.setFrom(Vector3(0, 10, 10));
  scene.textureBlendMode = BlendMode.hardLight;
  scene.world.add(Object(scale: Vector3(5.0, 5.0, 5.0), lighting: true, fileName: 'assets/chr_01.obj'));

zesage avatar May 18 '20 09:05 zesage

Hey @zesage, thanks a lot for the help, it works!

Does the lib support more than 1 light source? I've noticed ambient propriety for example but I'm not sure how it works.

ilyaviache avatar May 18 '20 19:05 ilyaviache

Only support 1 light source

zesage avatar May 19 '20 05:05 zesage

Hey @zesage. For some reason, I can’t load my 3D model into the project. Can you please see what the problem is if I throw off obj + mtl? Writes the error "out of memory".

Olega95 avatar May 20 '20 14:05 Olega95

Hey @zesage. For some reason, I can’t load my 3D model into the project. Can you please see what the problem is if I throw off obj + mtl? Writes the error "out of memory".

Please email me the obj files.

zesage avatar May 21 '20 08:05 zesage

Hello, I cannot load my obj file either. There are no errors in the console but the screen is just blank. Can you please see what the problem is?

annhoang14 avatar Jun 11 '20 17:06 annhoang14

Good afternoon, I've followed the example source code and I've added assets extention .obj and .mtl from the instructions. Then I got blank with the error Unhandled Exception: Exception: FormatException: Bad UTF-8 encoding 0x8d (at offset 62)

I've changed the .obj files to the others file and still the same. How can I fix it?

adrisinaga avatar Jun 15 '20 06:06 adrisinaga

Try to import the obj to Blender, then checked the Triangulate Faces when re-export to obj. And this widget can only render a small model, if the model has too many vertices, use Blender's Decimate tool to reduce the faces and vertices. If it still not work, email me the obj files.

zesage avatar Jun 16 '20 06:06 zesage

Hey, I tried loading a .obj file. It throws E/flutter (23098): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: Unable to load asset: error when compiling for Android. However, it works properly for the web.

bhavya-tech avatar Nov 04 '21 12:11 bhavya-tech

Hello I've put my own obj file into assets folder and try to load it but couldnt work, is there a guide on how to do it?

RYOTASHIMOGAITO avatar Dec 16 '22 04:12 RYOTASHIMOGAITO