Multiple Graph Output

Sid Kraft 101 Reputation points
2026-08-06T19:54:15.8+00:00
//OpenGL functions, open a window and initialize
void display(void)
{
	glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
	glClear(GL_COLOR_BUFFER_BIT);
	glLoadIdentity();
	//issue the GL commands
	glTranslatef(-.3, 0., 0.);
	glRotated(45.,0., 1.,0.);
	glScalef(.5, .5, .5);
	glColor3f(0., 0., 0.);
	glBegin(GL_LINES);
	I = 0.;
	do
	{
		//draw the axes
	if (I==0)
		{
		glVertex3f(0., 0., 0.);
		glVertex3f(1., 0., 0.);
		glVertex3f(0., 0., 0.);
		glVertex3f(0., 1., 0.);
		glVertex3f(0., 0., 0.);
		glVertex3f(0., 0., 1.);
		glVertex3f(0., 0., 0.);
		}
	//draw the curve
		glVertex3f(PLOTX[I], PLOTY[I], PLOTZ[I]);
		glVertex3f(PLOTX[I + 1], PLOTY[I + 1], PLOTZ[I + 1]);
		++I;
	} while (I <= INOW);
	glEnd();
	glFlush();

Have the above sequence of commands in the "visual" function, using the OpenGL glutInit and execute commands. Strange that the only output that I get is for the coordinate axes, not the curve data in the "do" loop? INOW=45

Sid Kraft

Developer technologies | Visual Studio | Other
Developer technologies | Visual Studio | Other

A family of Microsoft suites of integrated development tools for building applications for Windows, the web, mobile devices and many other platforms. Miscellaneous topics that do not fit into specific categories.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.