Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7966757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:31:01+00:00 2026-06-04T06:31:01+00:00

I’ve got a textured 4 corner polygon that I’m currently drawing using two triangles

  • 0

I’ve got a textured 4 corner polygon that I’m currently drawing using two triangles and GL_TRIANGLE_STRIP. The right side needs to be taller, and this messes things up. There’s a noticeable difference where the triangles intersect in the middle, how do I clear something like this up?

I think I need some sort of affine transform, or to subdivide into even more triangles, but I’m not sure.

screenshot: https://i.stack.imgur.com/ehW84.png

example code:

float x = rect.origin.x;
float y = rect.origin.y;
float w = x + rect.size.width;
float h = y + rect.size.height;
V2fT2f quad[4] = {
    //x  y
    { x, y, 0, 1 },//bottom left
    { w, y-0.2, 1, 1 },//bottom right
    { x, h, 0, 0 },//top left
    { w, h+0.2, 1, 0 },//top right
};
glEnable(GL_TEXTURE_2D);
glEnableClientState(GL_VERTEX_ARRAY);
glBindTexture(GL_TEXTURE_2D,texID);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);glErrorCheck();
glVertexPointer  (2, GL_FLOAT, sizeof(V2fT2f), &quad[0].x);
glTexCoordPointer(2, GL_FLOAT, sizeof(V2fT2f), &quad[0].s);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T06:31:02+00:00Added an answer on June 4, 2026 at 6:31 am

    In any case to get that effect with a transformation – you will need a perspective projection set up.

    After you’ve done that, here are your vertices (these form a rectangle of width and height)

    1. X: centerX – halfWidth, Y: y – HalfHeight, Tu: 0, Tv: 0
    2. X: centerX – halfWidth, Y: y + HalfHeight, Tu: 0, Tv: 1
    3. X: centerX + halfWidth, Y: y + HalfHeight, Tu: 1, Tv: 1
    4. X: centerX + halfWidth, Y: y – HalfHeight, Tu: 1, Tv: 0

    Enclose this inside a glRotatef(angle, 0, 1, 0) – rotate by angle degrees around the Y axis

    and that should give you what you need.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.