I’ve written a VRML97 to opengl scenegraph parser. Up until now, I haven’t needed to do anything with the texture/texture coordinate data - but now I need to add textures to the scenegraph.
My scenegraph can use either indexed vertex arrays or interleaved vertex arrays. The problem is, OpenGL doesn’t seem to allow you to have a texture coordinate per entry in the indices array (which would be damn useful). If this is true (and it seems to be), how the hell do I specify different texture coordinates for the same vertex? I don’t seriously have to duplicate vertices just to have different texture coordinates do I?!
All I want is to have a single texture spread across a mesh. But in a cylinder (for example) there is a problem with the last polygon in the curve of the cylinder, where it joins to the first one. For example, along the U axis of the texture I have the following coordinates (0, 1, 2, 3, 4). Obviously, where the texture is drawn from 4 - 0 , I get the texture repeated 5 times through the single polygon as it joins to 0.
I need the last poly to draw from tex coord 4 to tex coord 5, but not have to create another vertex (it’s already there in 0).
I’m a bit puzzled as to how I deal with the texture indices node in VRML. What the hell is that all about?