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 331665
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T09:47:43+00:00 2026-05-12T09:47:43+00:00

Imagine that you’ve got one of these guys: (source: codesampler.com ) Aka GL_TRIANGLE_STRIP. If

  • 0

Imagine that you’ve got one of these guys:

alt text
(source: codesampler.com)

Aka GL_TRIANGLE_STRIP. If you wanna color it using different colors, you could use:

glColorPointer(4, GL_UNSIGNED_BYTE, 0, colorArray);
glEnableClientState(GL_COLOR_ARRAY);

Where each “item” in the color array matches a vertex point in the strip. But what if the colors just alternate between two different colors? Feels unnecessary to define a color for each vertex, if there’s only two “real” different colors. So my question is if it’s possible to define a colorArray with just two colors in it, and somehow make opengl alternate between those two when it’s looping over the vertex array.

And yeah I’m a complete noob at opengl so maybe this is a stupid question…

  • 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-05-12T09:47:44+00:00Added an answer on May 12, 2026 at 9:47 am

    You can do this by using OpenGL Color Index Mode. However, be aware that, in my experience, this actually is slower on most modern graphics card than just specifying each vertex color.

    In color index mode, you send a separate color array, then each vertex specifies an index into the array, instead of a full rgb/rgba. It’s more memory efficient, but not as optimized in most hardware drivers.

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

Sidebar

Related Questions

Imagine that your web application maintains a hit counter for one or multiple pages
Imagine that in one data template, I have a textBox, and another data template,
Imagine that I have url http://www.google.com/subdomain/blah-blah.../.. /.. So I want to extract 4 things
Imagine you live in very simplified example land - and imagine that you've got
Imagine that you have a Person entity with a one to one relationship with
Imagine that a library contains many books that have many pages. I've got the
Imagine that users can have one or more roles in the system. after login
Imagine that users are inserting strings in several computers. On one computer, the pattern
Imagine that I have 100 SELECT queries that differ by one input. A PreparedStatement
Imagine that I want to access somebody's emails using YQL: I get consumer key

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.