I am trying to draw a simple 3D object generated by Google SketchUp 8 Pro onto my WebGL app, the model is a simple cylinder.
I opened the exported file and copied the vertices positions, indices, normals and texture coordinates into a .json file in order to be able to use it on javascript. Everything seems to work fine, except for the texture coordinates which have some pretty big values, like 46.331676 and also negative values. Now I don't know if I am wrong, but isn't 2D texture coordinates supposed to be in a range from 0.0 to 1.0 only?
Well, drawing the model using these texture coordinates gives me a totally weird look, and I can only get to see the texture properly when I am very close (not really me, the cam) to the model, as if the texture has been insanely reduced in it's size and repeated infinitely across the model's faces. (yeah, I am using GL_REPEAT on that texture wrap thing)
What I noticed is that if I get all these coordinates and divide them by 10 or 100 I get a much "normal" look, but still not in the 0.0 to 1.0 range.
Here's my json file: http://pastebin.com/Aa4wvGvv
Here are my GLSL Shaders: http://pastebin.com/DR4K37T9
And here is the .X file exported by SketchUp: http://pastebin.com/hmYAJZWE
I've also tried to draw this model using XNA, but still not working. Using this HLSL shaders: http://pastebin.com/RBgVFq08
I tried exporting the same model to different formats, collada, fbx, and x. All those yields the same thing.