Comments (7)
I had never seen this error before.
As a workaround I can suggest you to comment the following line Object3DBuilder.java:430 so you can load your obj while I investigate what's your issue.
What android version do you have?
from android-3d-model-viewer.
Android version on my device 6.0. I download 3d model in my Google disk, just try open it with your app and your definitely catch this bug.
https://drive.google.com/file/d/1MUcjTwOnxGJUrlPYHE7kegrQPUfINpB3/view?usp=sharing
from android-3d-model-viewer.
The problem is not with your model, as it is exploding compiling the shader for rendering DAE files.
Can you confirm that the app is exploding also with the included models?
from android-3d-model-viewer.
With existing models which in resources all ok. Problem only with models like that which I uploaded on google disk.
from android-3d-model-viewer.
I tried to download a similar model and catch this
01-22 18:54:38.799 29133-29750/com.example.alytar.bobbled E/GLUtil: Could not compile program: | const int MAX_JOINTS = 200;
const int MAX_WEIGHTS = 3;
uniform mat4 u_MVPMatrix;
attribute vec4 a_Position;
attribute vec3 in_jointIndices;
attribute vec3 in_weights;
uniform mat4 jointTransforms[MAX_JOINTS];
uniform mat4 u_MVMatrix;
uniform vec3 u_LightPos;
attribute vec3 a_Normal;
uniform vec4 vColor;
varying vec4 v_Color;
attribute vec2 a_TexCoordinate;varying vec2 v_TexCoordinate;void main()
{
vec4 totalLocalPos = vec4(0.0);
vec4 totalNormal = vec4(0.0);
mat4 jointTransform = jointTransforms[int(in_jointIndices[0])];
vec4 posePosition = jointTransform * a_Position;
totalLocalPos += posePosition * in_weights[0];
jointTransform = jointTransforms[int(in_jointIndices[1])];
posePosition = jointTransform * a_Position;
totalLocalPos += posePosition * in_weights[1];
jointTransform = jointTransforms[int(in_jointIndices[2])];
posePosition = jointTransform * a_Position;
totalLocalPos += posePosition * in_weights[2];
gl_Position = u_MVPMatrix * totalLocalPos;
gl_PointSize = 2.5;
vec3 modelViewVertex = vec3(u_MVMatrix * a_Position);
vec3 lightVector = normalize(u_LightPos - modelViewVertex);
vec3 modelViewNormal = vec3(u_MVMatrix * vec4(a_Normal, 0.0));
float diffuse = max(dot(modelViewNormal, lightVector), 0.1);
float distance = length(u_LightPos - modelViewVertex);
diffuse = diffuse * (1.0 / (1.0 + (0.05 * distance * distance)));
diffuse = diffuse + 0.5; v_Color = vColor * diffuse;
v_Color[3] = vColor[3]; v_TexCoordinate = a_TexCoordinate;}
01-22 18:54:38.802 29133-29750/com.example.alytar.bobbled E/GLUtil: Error compiling program: L0100 GLSL allows exactly two attached shaders (one of each type) per program
01-22 18:54:38.810 29133-29750/com.example.alytar.bobbled E/ModelRenderer: There was a problem rendering the object 'figurine_ABCDEFG.obj':Error creating program.
java.lang.RuntimeException: Error creating program.
at com.example.alytar.bobbled.ui.activity.show3dModel.show3dModelUtil.util.GLUtil.createAndLinkProgram(GLUtil.java:65)
at com.example.alytar.bobbled.ui.activity.show3dModel.show3dModelUtil.Object3DImpl.(Object3DImpl.java:45)
at com.example.alytar.bobbled.ui.activity.show3dModel.show3dModelUtil.Object3DV9.(Object3DImpl.java:963)
at com.example.alytar.bobbled.ui.activity.show3dModel.show3dModelUtil.Object3DBuilder.getDrawer(Object3DBuilder.java:427)
at com.example.alytar.bobbled.ui.activity.show3dModel.show3dModelUtil.model.ModelRenderer.onDrawFrame(ModelRenderer.java:174)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1590)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1286)
Honestly, I don't understand how to fix this, and how make it that the file .mtl was read. I find that Object3DData.class / byte[] textureData = null all time.
from android-3d-model-viewer.
I Use my obj and dae and also byte[] textureData is null all time,
When the examples works great.
from android-3d-model-viewer.
Fixed in lastest version. Tested on my phone. If it's not ok for you, reopen issue.
from android-3d-model-viewer.
Related Issues (20)
- improve demo feature
- implement geometry demo
- rename packages and rebrand to org.the3deer
- F-Droid build failed HOT 5
- How to rotate camera on Y axis by angle (-180 degrees ~ 180 degrees)
- I want to load a single model directly from REPO_URL HOT 1
- Load Texture from picture does not work
- How to display text under each object? I tried many methods but failed
- Load the text record for reference to anyone who encounters the same problem HOT 1
- How to add a sliding buffer effect when the gesture is dragged up HOT 1
- Some GLTF model load failed HOT 1
- lighting effects HOT 2
- How to display in AR?
- Can't build
- Camera lag
- The problem that the bounding box is not drawn
- Can we add jpeg or PNG file on GLTF file on specific position using library settings or functions
- Using android-3D-model-viewer as library
- The loaded 3D model can be deleted and then reloaded with a new one
- How to render the dae object on opengl for ARCore?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-3d-model-viewer.