Adding vertexes with UV coords

Blitz3D Forums/Blitz3D Programming/Adding vertexes with UV coords

Chaduke(Posted 2005) [#1]
If you look at the AddVertex command in the help file regarding UV coords it explains that the bottom left of an image is 0,0 and the top right is 1,1 but when I apply a texture to a surface with this in mind the texture displays upside down and backwards.

To do it correctly I need to think of 0,0 being upper left and 1,1 being lower right. Is the help file wrong or am I missing something here?


*(Posted 2005) [#2]
its the same on my machine, however this also is dependent on how you create the poly/triangle too.


Andy(Posted 2005) [#3]
>Is the help file wrong or am I missing something here?

You are reading the textfile wrong.

http://www.blitzbasic.co.nz/b3ddocs/command.php?name=AddVertex&ref=comments

This is the same helpfile as the docs.

The top left of an image has the uv coordinates 0,0. 
The top right has coordinates 1,0 
The bottom right is 1,1. 
The bottom left 0,1.


Andy


Snarkbait(Posted 2005) [#4]
IIRC it used to be incorrect in the docs, now it is correct... chaduke you might need the newest version of the docs.


Gabriel(Posted 2005) [#5]
IIRC it used to be incorrect in the docs, now it is correct


Yes it definitely was incorrect in the docs. They must have got round to correcting it at some stage because it's right now.


Chaduke(Posted 2005) [#6]
"You are reading the textfile wrong."

Wow, it would be something if that were the case. I was actually reading it wrong and imagining the correct way in my head while it was actually written correctly right in front of me, then I bothered to post on the board about my confusing dilemma. I suppose stuff like that happens fairly often on message boards though.


Andy(Posted 2005) [#7]
>Wow, it would be something if that were the case.
>I suppose stuff like that happens fairly often on message
>boards though.

It does happen fairly often.

Often the most irritating problems are those which are really the most simple. Spelling mistakes, differences in nomenklature, lack of understanding etc. When people can't see the forrest for the trees kind of situation.

I apologize for the abrupt remark though, I could have offered a more thorough explanation.

Andy


Damien Sturdy(Posted 2005) [#8]
I ignore the docs, and create the vertex' in the order i want the textures to be... starting bottom left, bottom right, top left, top right.

Never had any issues or needed to worry about the docs :)


Chaduke(Posted 2005) [#9]
For some reason I was under the impression that the patcher updated the docs as well.

I'm glad I asked though because I'm noticing a ton of documented commands I didn't know were even there. Thanks for the replies.

Cygnus - I'm not quite sure I follow you.

You're describing a "Z" pattern in terms of how you add the vertices. What I did was create a quad by creating four vertices, then adding the two triangles each with 3 vertices in a clockwise order so the face would be visible. The only time I thought the order was important is when you create the triangles because it determines the way the face will be pointing.

Is this different from the way you do it?


Ross C(Posted 2005) [#10]
Well, the UV co-ords are stored with the vertices. So, if you create them in different positions, but give them the same UV co-ords, the texture will be displayed at a different angle :o) What i think he means.


Damien Sturdy(Posted 2005) [#11]
What Ross C said...

I'm just no good at describing stuff :)