Texture coordinates

i’m getting on with some vertexbuffer experiments but what i don’t know is how to generate the texture coordinates for the vertexbuffer…any hints?

Texture coordinates are always in relation to the vertex in the corresponding buffer position.
So when transforming a vertex, the texture gets transformed as well without having to transform its coordinates.

I made a small patch for you to show you how 2D texture coordinates are used to expand a texture over a models surface. Hope this will help a bit.

Enjoy!

Sven

texture_coordinates.zip (45.8 kB)

the 2dimensional thing i understand but i don’t know how to translate this to a 3dimensional object or texture mapping…see patch

texture_coordinates2.zip (50.7 kB)

uii… looks interesting, doesn’t it? ;)

well… I’m not quite sure what you are up to. However, every surface, 2D or 3D, has to be seen as a two-dimensional map. So imagine your objects skin being a flat map.
Also, you might need as many tex coords as there are vertices if you like to stretch the texture over the whole mesh.
In your patch you have a sphere made of 212 vertices, so the four tex coords you applied here are not enough. That’s why they get repeated over and over again.
There are many techniques of mapping a texture onto an object, so it depends on what you need for your project.
The primitives that come with VVVV as EX9 geometries, such as the sphere you used, have simple UV-Coordinates, which you can extract with the VertexBuffer node by activating the TexCoords pin using the inspector.
Maybe you should just play around with them for a while to get an impression how to manipulate them or create new ones.
Of course there are methods of working with more than two-dimensional textures but I guess that’s not what you are really looking for right now. Please correct me if I’m wrong.

Cheers,

Sven

hehe…this was the missing bit…the texture coordinate pin

and again, always have a look at herr inspektor :) . . . how stupid i am sometimes