Distort maps U, and V explanation

This forum is currently in read-only mode.
  • Can some one give me a definitive explanation of how U, and V work in a distort map?

    There's nothing in the wiki, that I can find, and its kind of hard to figure out just by experimenting.

    Also is there any difference as far as U, and V go in how they act to relative, and absolute?

  • In 3d apps, UV's are the texture coordinates, 0.0 - 1.0.

    That probably didn't help at all

  • The U and V values are pretty much equivalent to X and Y positions, but for texture coordinates. They stand for the point on the texture that associates with a vertex. In Construct these coordinates are actually numbered like screen coordinates rather than values from 0.0 - 1.0.

    Here's an image showing an example of UV coordinates:

    <img src="http://dl.dropbox.com/u/917406/UVexplanation.png">

    Since Construct's sprite meshes require displacement values, these wouldn't be the actual values. The real values, starting with the left square, would be 0, 0 all the way around; the right square, on the other hand, would -- going from the top-left corner around clockwise -- have these values:

    1 - 0, 0

    2 - 128, 0

    3 - 128, 128

    4 - 0, 128

    Hopefully I explained all of this well enough and that I got the main idea across. Hope this helps.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thanks linkman, thats great!

  • Thanks, that helps a lot. I think the thing that was screwing me up was the zeros, that and always confusing u and v. Then how each only represents one row/column.

  • Ok question.

    Thus far everything starts with zero. Should U, and V in the above example start with zero and end with 127?

  • I think it is the corner coordinates.

    If you have one pixel texture, 0,0 would be top left corner and 1,1 would be bottom right.

  • Egad making a tileable texture using loops is going to be a nightmare!

  • Egad making a tileable texture using loops is going to be a nightmare!

    what do you mean?

    if you want to infinitely scroll a tileable texture using uv, I've done that and it wasn't hard at all.

  • Well Im using a distort map set higher than 2 columns/rows, plus z heights. What Im wanting is more like 50.

    The problem is arranging the quadrants within the loop, or I should say loops.

    In a loop you first define the distort maps size.

    50 in this case so 49 columns/rows.

    That also gives me how many steps x, and y wise.

    Within a nested loop its:

    For x= 0 to 49

    for y= 0 to 49

    >distort map set relative displacement at loopindex(x), loopindex(y)

    The problem is for each x,y step I have to set u, and v to one of four quadrants 0,0| texture size,0 | 0,texture size | texture size,texture size.

    So I either need to add two more loops or devise a way using private variables.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)