Hi everyone was just messing around trying to create a makeshift planetary system and I have created the planets (Cubes). But when trying to generate new vertices for the Orbits (Hollow Circle), it justs gives me a blank screen any help would be appreciated! The black screen comes out immediately when I call generate_orbit() without even adding it to any of the buffers :tired:
Thanks in advance!
struct Vertex //Basic struct to store the Vertex info
{
GLfloat position[3];
GLfloat color[3];
};
void generate_orbit(float centreX, float centreY, float centreZ, float circleRadius)
{
float angle = PI * 2 / static_cast<float>(orbit_slices); // used to generate x and y coordinates
// generate vertex
for (int i = 0; i < orbit_slices + 2; i++)
{
// multiply by 3 because a vertex has x, y, z coordinates
g_orbitVertices[i].position[0] = circleRadius * cos(angle) + centreX;
g_orbitVertices[i].color[0] = 1.0f;
g_orbitVertices[i].position[1] = circleRadius * sin(angle) + centreY;
g_orbitVertices[i].color[1] = 0.0f;
g_orbitVertices[i].position[2] = circleRadius + centreZ;
g_orbitVertices[i].color[2] = 0.0f;
// update to next angle
angle += PI * 2 / static_cast<float>(orbit_slices);
}
return;
}