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

  • Home
  • SEARCH
  • 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 8685661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:38:02+00:00 2026-06-12T22:38:02+00:00

I am trying to figure out index buffers. I read the MSDN & another

  • 0

I am trying to figure out index buffers. I read the MSDN & another thread on it [ Struggling With Vertex And Index Buffers In Direct3D ].

I thought I got it, but in practice, I could not get it to work. I was trying to make a square.

I have 6 vertices:

    SimpleVertex vertices[]={ // {Position, Color}
        {XMFLOAT3(-0.5f, 0.5f, 0.5f), XMFLOAT4(0.8f, 0.2f, 6.0f, 1.0f)}, // top left
        {XMFLOAT3(0.5f, -0.5f, 0.5f), XMFLOAT4(0.8f, 0.2f, 6.0f, 1.0f)}, // bottom right
        {XMFLOAT3(-0.5f, -0.5f, 0.5f), XMFLOAT4(0.8f, 0.2f, 6.0f, 1.0f)}, // bottom left

        {XMFLOAT3(-0.5f, 0.5f, 0.5f), XMFLOAT4(0.8f, 0.2f, 6.0f, 1.0f)}, // top left
        {XMFLOAT3(0.5f, 0.5f, 0.5f), XMFLOAT4(0.8f, 0.2f, 6.0f, 1.0f)}, // top right
        {XMFLOAT3(0.5f, -0.5f, 0.5f), XMFLOAT4(0.8f, 0.2f, 6.0f, 1.0f)}, // bottom right
    };

& an array of indices:

    unsigned short indices[]={
        0,3,2, // a d c
        0,1,3, // a b d

        // a---b
        // | \ |
        // c---d
    }

but that does not display anything. If I change the indices to 0,1,2,3,4,5, it works [defeats the point of the index though].

Anyone know what is wrong with the way I think of indices?

  • 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-12T22:38:03+00:00Added an answer on June 12, 2026 at 10:38 pm

    Oops, took me a while after I posted to figure out my problem.

    1] I listed the vertices as if I was going to draw it manually. I should have had just 4 vertices [not 6].
    The index connects the dots; 1st 3 indices make 1st triangle, 2nd 3 make 2nd triangle.

    2] I thought the numbers in the index array represented sides on a shape I imagined [not sure how that even works :P]. They actually represent the position in the array of vertices.

    Hope this helps others.

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

Sidebar

Related Questions

I'm trying to figure out how to get the index of the current rowspanned
I'm just trying to figure out how to create an index inside a function
I am trying to figure out a way to increment an index of an
I'm trying to figure out whats holding the index speed back. I'm extracting text
I'm trying to figure out how to add an index to a LINQ query
I am trying to figure out an out of bound index issue i am
Trying to figure out how to pull values for a specific index in an
I am trying to figure out how to get access to the current index
I'm trying to figure out how to use CompositeId to map another class. Here's
I'm trying to figure out how to get the index value of an objects

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.