#### Archived

This topic is now archived and is closed to further replies.

# OpenGL Mapping problem in OpenGL

This topic is 6676 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Why doesn´t this triangle strip work? ( want to use tsrip not quadstrip)
  glBegin(GL_TRIANGLE_STRIP); glNormal3f (0, 0, 1); glTexCoord2f(0, 0); glVertex3f (0, 0, 0); glTexCoord2f(0, 1); glVertex3f (0, 1, 0); glTexCoord2f(1, 0); glVertex3f (1, 0, 0); glTexCoord2f(1, 1); glVertex3f (1, 1, 0); glEnd(); 
Thanks, Zeblar Nagrim, Lord of Chaos Edited by - Zeblar Nagrim on 7/13/00 2:56:44 AM

##### Share on other sites
To make a triangle strip you draw the quad like a "z". Why can´t I get it to work in GL?

// 1 // 3

// 0 // 2

Alright the quad show up. But the mapping is totaly wrong:

To set u,v. right for a 1x1 size quad created with tstrip:

bottom left = 0,0
top left = 0,1
bottom left = 1,0
bottom top = 1,1

In GL it is:

bottom left = 0,1
top left = 0,0
bottom left = 1,1
bottom top = 1,0

Why this displacement?

Zeblar Nagrim, Lord of Chaos

##### Share on other sites
I think I know the answer to my question now.
OpenGL draw primitives anti-clockwise and Direct3D the other way around.

Zeblar Nagrim, Lord of Chaos

##### Share on other sites
Your texture coords look ok to me.

GL is indeed:
(0,0) bottom left
(0, 1) top left
(1, 1) top right
(1, 0) bottom right

So that''s not the problem.

It''s been a while since I''ve used triangle strips, so this is probably wrong, but try creating the first triangle of the strip with anti-clockwise winding. You may be drawing everything upside down. Then again I get the impression that I''m talking crap :p

I''ll try it out later.

##### Share on other sites
Your texture coords look ok to me.

GL is indeed:
(0,0) bottom left
(0, 1) top left
(1, 1) top right
(1, 0) bottom right

So that''s not the problem.

It''s been a while since I''ve used triangle strips, so this is probably wrong, but try creating the first triangle of the strip with anti-clockwise winding. You may be drawing everything upside down. Then again I get the impression that I''m talking crap :p

I''ll try it out later.

##### Share on other sites
Dear mr moderator.

Please forgive my abject stupidity by forgetting to enter my username and then posting twice.

##### Share on other sites
HAHAH LOL

Actually it isn''t your fault totaly GDNET needs to make a login cookie for a month or year

1. 1
Rutin
47
2. 2
3. 3
4. 4
5. 5

• 13
• 10
• 12
• 10
• 13
• ### Forum Statistics

• Total Topics
632994
• Total Posts
3009766
• ### Who's Online (See full list)

There are no registered users currently online

×