|
Post by cosmicfloppydisk on Jun 1, 2017 23:34:14 GMT
Texture coordinates are confusing me, for a square image I would expect the maxs and maxt to return 1, but I get really weird values
|
|
|
Post by Admin on Jun 2, 2017 10:39:02 GMT
to get image size use image.contentsize not image.size
|
|
|
Post by cosmicfloppydisk on Jun 2, 2017 12:59:33 GMT
This image is the same format as the first one but with image.contentsize I still just don't understand these texture coordinates. What is maxs and maxt telling me
|
|
Guy
New Member
Posts: 18
|
Post by Guy on Jun 10, 2017 9:44:32 GMT
I think maxs and maxt are like the width and height for images but in texture mapping coordinates, which are in float values in the range of 0 to 1 This might help better explain texture coordinates: stackoverflow.com/questions/5532595/how-do-opengl-texture-coordinates-workYou can mess with the maxs and maxt in the textured cube example to see in action what that above was explaining about Your maxs and maxt values when you used image.contentsize were obtained by dividing the width and height by the next highest power of 2 for your image's size, in your case 1024, that I don't why, but I'm going to guess it just makes texture images in powers of 2 for reasons you'll need to ask someone else more knowledgeable about it
|
|
|
Post by cosmicfloppydisk on Jun 10, 2017 10:23:22 GMT
I think maxs and maxt are like the width and height for images but in texture mapping coordinates, which are in float values in the range of 0 to 1 This might help better explain texture coordinates: stackoverflow.com/questions/5532595/how-do-opengl-texture-coordinates-workYou can mess with the maxs and maxt in the textured cube example to see in action what that above was explaining about Your maxs and maxt values when you used image.contentsize were obtained by dividing the width and height by the next highest power of 2 for your image's size, in your case 1024, that I don't why, but I'm going to guess it just makes texture images in powers of 2 for reasons you'll need to ask someone else more knowledgeable about it Thank you, that's what I kinda felt was happening is it was rounding up to a "square number". Our engine is OpenGL, so I've been looking at their documentation page about texture coordinates. But this rounding thing I don't see on there. Anyway thanks.
|
|