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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T01:29:20+00:00 2026-06-07T01:29:20+00:00

I am making a simple test application in C that is supposed to generate

  • 0

I am making a simple test application in C that is supposed to generate three dimensional dice. I am going to use OpenGL to do the actual drawing, but I cannot figure out how to actually generate the vertices. Of course, the whole point of this test was to see if my algorithm worked, but I found a major logic error that I cannot fix. Can somebody please point me to an article, website, or something that explains the concept? If not, although I would prefer to do the actual implementation myself, the C code is acceptable.

Basically, this is what I did before I forgot what I was doing for the algorithm:

void calculateVertices(int sides) {
    BOOL isDone = FALSE;
    int vectorsPerSide = 3;
    VDVector3f *vertices = malloc((sizeof(VDVector3f) * (sides + 1)));
    VDVector3f *normals = malloc((sizeof(VDVector3f) * (sides + 1)));

    while (!isDone) {
        // Start by positioning the first vertex.
        vertices[0] = VDVector3fMake(0.0, 0.0, 1.0);

        for (int index = 1; index <= sides; index ++) {

        }

        // Not a match, increase the number of vectors
        vectorsPerSide ++;
    }
}

Basically, it loops until a match is found. This sounds inefficient to me, but I had no other idea as to how to do this. The first vertex will actually be removed from the array at the end; I was going to use it to create the first side, which would have been used to properly position the others.

My main goal here is to be able to pass number (like 30) to it, and have it set the vertices automatically. I will not have protections against making one sided and two sided dice, because I have something special in mind. I will have those vertices entered elsewhere.

Thanks in advance for the help!

By the way, I have an algorithm that can normalize the completed vertex array. You don’t have to bother helping with that.

  • 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-07T01:29:22+00:00Added an answer on June 7, 2026 at 1:29 am

    I don’t think this is possible to generalize this. How, for example would you make a fair 5 or 9 sided die? I don’t think I have ever seen such a thing. A quick search on wikipedia suggests platonic solids may be what you are after. http://en.wikipedia.org/wiki/Platonic_solid

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

Sidebar

Related Questions

I am writing an simple test application that needs to take a url as
Making a simple application, so when the user logs out of Windows, it of
in making a simple cgi server for a course. To do that in some
I'm making a simple mediaplayer app that downloads a song from a predetermined URL
I am making a simple website and am writing a gradle build script that
Here's the deal, I've been working on making a simple screen locker app that
I've got a sample application on http://github.com/niklassaers/Test-iPhone-TabBar-App that shows my problem: I have a
I'm writing a rather simple application that uses GWT, Hibernate and Google Guice (with
I'm making a simple GUI library, and I've gotten to the first test. The
I am making this ajax call: $.ajax({ url: /test/whatever, type: 'post', contentType: 'application/json' data:

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.