the3deer / android-3D-model-viewer

Android OpenGL 2.0 application to view 3D models. Published on Play Store
https://play.google.com/store/apps/details?id=org.andresoviedo.dddmodel2
MIT License
1.43k stars 376 forks source link

How to upload texture from github without CreateChooserDialog #150

Open rutraq opened 4 years ago

rutraq commented 4 years ago

Hello. I have a problem. I want just to send a uri and upload the texture of a 3D model. But something goes wrong. Please help me how to do this without this AlertDialog. Probably I needn't a function ContentUtils.createChooserDialog XDiWYaaTXgk

andresoviedo commented 4 years ago

hi. if you want to update an object texture you can code something like this

obj.getMaterial().setTextureData(IOUtils.read(ContentUtils.getInputStream(uri)))

This code updates the material texture data with the raw bytes of your bimap. Mind that the object must have texture coordinates for that to work.

Hope this helps

rutraq commented 4 years ago

hi. if you want to update an object texture you can code something like this

obj.getMaterial().setTextureData(IOUtils.read(ContentUtils.getInputStream(uri)))

This code updates the material texture data with the raw bytes of your bimap. Mind that the object must have texture coordinates for that to work.

Hope this helps

Don't understand exactly what I need to do

rutraq commented 4 years ago

Just need like this without ChooserDialog. But in this case it's doesn't working image

andresoviedo commented 4 years ago

Hi. The code you sent I think it should work

Would you please paste The logcat output?

rutraq commented 4 years ago

Hi. The code you sent I think it should work

Would you please paste The logcat output?

Hi. It's don't work( image