i'm having a problem with the texture mapping with the colladaLoader example. The textures in my model are attatched with UVW mapping and loaded in the scene but the mapping is wrong. Only the baked taxtures apear correctly.
Any ideas how to fix that?
Thank you in advance!!
Can you share a screenshot?
Here is a screenshot: http://dl.dropbox.com/u/563937/Screen%20shot%202012-05-23%20at%2012.05.19%20%CE%BC.%CE%BC..png
as you can see i have many issues. The most important is the texture coordinates. The flags you see in the back have baked texture (i use cinema4d) so they apear correctly. I was about to bake all the surfaces in my scene, but i haven't done it yet.
Another important issue is that the faces are not doubleSided so they are visible from one side only. The easy solution (for me) for this would be to dublicate the surfaces and reverse the direction. But this will make my file much bigger... :s ...
I don't know much about Collada or ColladaLoader but purely from WebGL point of view it looks like these textures should have repeat wrapping but instead they use clamping.
It could be that either somewhere in the Collada pipeline this information is lost, or maybe your textures are not power of 2 (this will result in clamping even if everything else is correct).
The same thing for doubleSided faces - we have API for this on three.js side but not sure about Collada pipeline.
Which means at minimum, you should be able to fix all this on JS side, upon loading of the model, though it would be better if this could be handled directly in the Collada pipeline (it's also possible loader is ok and it's exporter that loses info).
Any chance you could share an example dae or the source dae? That would make troubleshooting the issue much easier if possible. You can share privately if you wish. I have helped others that way. Thanks
Thanks for your help! Here is a test scene: http://dl.dropbox.com/u/563937/threejs/examples/PKRpart1_02tester.html
Just to let you know, i don't have much experience with coding, so what i did here is a combination of "loader_collada" with "loader_ctm_materials" example.
And here the collada test file: http://dl.dropbox.com/u/563937/threejs/examples/models/smallTesterR12.zip
This is not my full model actually. It is a part from "part 1". I'm thinking to split my scene into 2 parts because it's very big... What i want to do is just to navigate in my scene. I just want to fix the material mapping, the doublesided issue, add a nice "Loading..." tracker (important because it takes time to load...) and also i don't know why i can't see the "skybox" (it's in the code..).
If i could go a step further i would like to add some Clickable Points in my scene that open some Renders (images). (So every "point" would be placed in the relevant point of view of my camera...). This is very advanced for me... but i have it in mind.. :P
...I just found out something strange. I opened the collada file with MeshLab and my textures where places in random surfaces... not all of them but some of them. So i guess there is something wrong with my collada file. I export it from Cinema4d...
Your textures are not power of two. Try resizing them to sizes like (512x512, 1024x1024, 2048x2048, 1024x512, ...)
Yes you are right. That was the problem. Thanks!!! Sorry for that i didn't know about the power of 2.. :/
What about the doubleSided issue?..
thanks for your help everyone!