Forums > Jitter

Texure coordinates in jit.gl.mesh

February 4, 2012 | 4:51 pm

Hi

I am having a problem understanding how to deal with texcoord in jit.gl.mesh. I have figured out how to get to grips with the mesh vertices (took some time to realize that one has to think in triangles, not in squares when composing the mesh)but when I apply a texture I am simply lost in making it fit to the mesh. Anyone can give me a helpful hint since the Max documentation is far from helpful with this. I guess I should be more hardcore openGL but alas, I am not so please… Some helpful insight in how to handle jit.gl.nurbs would also be of great assistance (as the bright observer might have realized I am trying to get into a working mapping system here)


February 4, 2012 | 5:24 pm

Yes, I know there should be no need to fiddle with the texture coordinates but it seems (silly me) that there is. As I apply a texture (with no specification whatsoever)I only get a few pixels from the texture I try to apply. Obviously I have no understanding of this object since all others work for me (gridshape, videoplane, nurbs whatever…)


February 4, 2012 | 5:48 pm

So here is a test patch just to demonstrate my dilemma…
Anybody out there????

Attachments:
  1. MeshMapping.maxpat

February 4, 2012 | 5:49 pm

Aaaah, yes please click the first preset to create a square plane shape for the mesh…


February 4, 2012 | 7:34 pm

Texture coordinates typically range from [0, 1]. Here’s how to use jit.expr to generate coordinates for a plane:

– Pasted Max Patch, click to expand. –

February 6, 2012 | 2:22 pm

Thanx a lot Wesley… Still kind of lost in translation since I´m new to the concept. Am I correct to suppose that the range 0-1 is relative to the object the texture is mapped to? Annoying fact that distorting one vertex only applies the distortion to the closest triangle instead of interpolating over the whole surface… aaaah, so much new ways to think and so little time…


February 6, 2012 | 5:22 pm

> Thanx a lot Wesley… Still kind of lost in translation since I´m new to the concept. Am I correct to suppose that the range 0-1 is relative to the object the texture is mapped to?

What do you mean by relative to? Texture coordinates should be given for every vertex of geometry. What the describe is which pixel from the texture will map to that particular vertex of the geometry.

> Annoying fact that distorting one vertex only applies the distortion to the closest triangle instead of interpolating over the whole surface… aaaah, so much new ways to think and so little time…

Not sure exactly what you mean, but if you only manipulate a single vertex or texture coordinate, only that part of the mesh will be warped. If you want to manipulate things across the entire object, you can use a slab to warp the texture itself or a shader to warp how the texture maps onto the geometry.


February 7, 2012 | 1:18 pm

Hi Wesley,

I also had problems with jit.gl.mesh and texturing but it seems i’m still doing something wrong here. I had the same problem of not knowing what input was needed so i welcome this thread with open arms but even with the texture-coordinates it still isn’t displayed correct. There is a little tweak in my patch so without it everything works fine but the tweak is just the effect i’m after :)

I’ve also been trying to go the shader-route but that is completely new terrain for me and i fear i’m a bit lost…

Thanks,
FRid

– Pasted Max Patch, click to expand. –

Viewing 8 posts - 1 through 8 (of 8 total)