Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve uv docs #9

Open
nickdesaulniers opened this issue Jul 24, 2014 · 3 comments
Open

improve uv docs #9

nickdesaulniers opened this issue Jul 24, 2014 · 3 comments

Comments

@nickdesaulniers
Copy link
Contributor

currently the docs for atlas.uv() state:

var uvmap = atlas.uv();
/* {
              TOP   RIGHT  BOTTOM  LEFT
  'name':  [ [0,0], [1,0], [1,1], [0,1] ],
} */

When I think of a quad, I think of four pairs of points, so instead of TOP, RIGHT, BOTTOM, and LEFT, I would expect something more like TOP-LEFT, TOP-RIGHT, BOTTOM-LEFT, BOTTOM-RIGHT.

@nickdesaulniers
Copy link
Contributor Author

The order looks to me like BOTTOM-LEFT, BOTTOM-RIGHT, TOP-RIGHT, TOP-LEFT. I assume you're using uv coordinates where the origin is in the bottom left most corner? Because the existing docs don't suggest that either are correct?

@nickdesaulniers
Copy link
Contributor Author

Assuming the origin is implied to be in the top left, which I guess makes sense for canvas 2d, then the order is TOP-LEFT, TOP_RIGHT, BOTTOM_RIGHT, BOTTOM_LEFT. That's really going to trip up someone looking for uv coordinates if they're assuming uv coordinate system.

@shama
Copy link
Owner

shama commented Jul 24, 2014

This library was originally written for use in voxel-texture. The coordinates are based on what is used in voxel.js and three.js. I'm happy to take a patch for improvements though. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants