A c++, opengl program for creating a spinning a cu
2016-08-23
0 0 0
no vote
Other
Earn points
// A program to display a spinning cube
#include<stdlib.h>
#include<GL/glut.h>
GLfloat vertices[]={-1.0,-1.0,-1.0,1.0,-1.0,-1.0,1.0,
1.0,-1.0,-1.0,1.0,-1.0,-1.0,-1.0,1.0,
1.0,-1.0,1.0,1.0,1.0,1.0,-1.0,1.0,1.0}; // Drawing the cube and inputting colours
GLfloat colors[]= {0.0,0.0,0.0,1.0,0.0,0.0,1.0,1.0,0.0,
0.0,1.0,0.0,0.0,0.0,1.0,1.0,0.0,
1.0,1.0,1.0,1.0,0.0,1.0,1.0};
GLubyte cubeIndices[]={0,3,2,1,2,3,7,6,0,4,7,3,1,2,6,5,4, 5,6,7,0,1,5,4};
static GLfloat theta[]={0.0,0.0,0.0};
static GLint axis=2;
void display(void)
{
glClear(G
#include<stdlib.h>
#include<GL/glut.h>
GLfloat vertices[]={-1.0,-1.0,-1.0,1.0,-1.0,-1.0,1.0,
1.0,-1.0,-1.0,1.0,-1.0,-1.0,-1.0,1.0,
1.0,-1.0,1.0,1.0,1.0,1.0,-1.0,1.0,1.0}; // Drawing the cube and inputting colours
GLfloat colors[]= {0.0,0.0,0.0,1.0,0.0,0.0,1.0,1.0,0.0,
0.0,1.0,0.0,0.0,0.0,1.0,1.0,0.0,
1.0,1.0,1.0,1.0,0.0,1.0,1.0};
GLubyte cubeIndices[]={0,3,2,1,2,3,7,6,0,4,7,3,1,2,6,5,4, 5,6,7,0,1,5,4};
static GLfloat theta[]={0.0,0.0,0.0};
static GLint axis=2;
void display(void)
{
glClear(G
c++
Related Source Codes
Local Path Planning Algorithm - DWA Algorithm
0
0
no vote
enDAQ-Shock-Data-Share-SRS-Blog
0
0
no vote
Calling chatGPT in a Windows application
0
0
no vote
Test Hello world
0
0
no vote
RCS calculation by one-way ray tracing
0
0
no vote
No comment