Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / Is the V coord for SetSpriteUV wrong, or am I wrong?

Author
Message
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 8th Apr 2019 03:35
I thought the top left corner of an image is (0,1). Even The Google says its (0,1). But I have to use(0,0) for the SetSpriteUV commands to work. Am I doing something wrong? I am a very confused. Appreciate if I someone could correct me.

Thanks.
Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 8th Apr 2019 09:20 Edited at: 8th Apr 2019 09:33
On an image in AppGameKit, the upper left UV coordinates are 0,0 and bottom right of the image is (1,1)



- This is similar to screen coordinates starting at top left.
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 8th Apr 2019 13:56
Thanks.

It's this way for images used for 3D, as well? Seems like a silly question, but I thought I had to use (0,1) in the past. Not surprised if I am wrong.
Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 8th Apr 2019 15:38
Its the same in 3D too....the 0,0 UV coordinates are the top left of the image.


I can see why you would think 0,1 would be top left as in Open GL that is typically the case but in Direct X and Web GL 0,0 is the top left. In open GL a texture matrix is set so technically any corner of the image or even its centre could be represented by 0,0 but for use in AppGameKit 0,0 is the top left of the image.
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 8th Apr 2019 17:13
Thanks for clearing it up!
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 10th Apr 2019 08:10
Kinda late, but this might help.
https://www.zimnox.com/resources/articles/tutorials/?ar=t004
Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 10th Apr 2019 15:43
Haha,

That is the article I read that lead me to using [0,0].
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 1st May 2019 06:37
lol, doh!
Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds

Login to post a reply

Server time is: 2024-04-20 08:55:33
Your offset time is: 2024-04-20 08:55:33