Jump to content
  • Advertisement

Archived

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

Zeblar Nagrim

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.

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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 this post


Link to post
Share on other sites
Guest Anonymous Poster
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 this post


Link to post
Share on other sites
Guest Anonymous Poster
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 this post


Link to post
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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!