-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Model Appear Black initially when Texture Applied #5
Comments
In WebGL all texture objects appear black until the texture file is loaded. You can set a callback function to conversion which is called when a texture is loaded. In the callback you should call Draw: var meshes = JSM.ConvertModelToThreeMeshes (model, materials, {
textureLoadedCallback : function () {
viewer.Draw ();
}
}); |
Tried it , but not working. |
And what happens? Are there any console error messages? Are your viewer visible in this scope with this name? If you could not figure out what is the problem, you can force the viewer to redraw continuously by calling StartDrawLoop. In this case it will be redrawed every time, not just in case of navigation, so I think the first solution is better. viewer.StartDrawLoop (); |
No specific error messages , there are couple of warnings from three.js but they are there since beginning
My viewer however is working the same way, comes out with model as black and then as soon as you moves it around , the texture gets displayed. Second my primary working browser is Firefox however i tried using Internet Explorer and at few times , IE does display the model with texture in the first attempt say 1 out of 7 times it does, rest it remains black. here is the code for the reference along with the svg. SVG
Code
|
FireFox : 33.1 |
The callback name is textureLoadedCallback, not textureCallback. |
Now i am seriously embarrassed.. deepest apologize, my BAD!!!!! Thanks for such a wonderful work. |
You welcome :) |
Hi , in continuation on my previous issue, now that the texture has been applied successfully, however on the first view , the model appear completely black , however as soon as you starts to move it, the texture suddenly appears with all the glory. Is there something that can be easily fixed or if somehow we can force the update for the texture. In case of single color fills, this issue doesnt exist and only happends when you apply a texture.
The text was updated successfully, but these errors were encountered: