void Streamline::RenderStreamlines(GLfloat *eigenfloats){
	
	if( this->bVisible ){								// if they are visible then draw. Otherwise no need.
		this->DrawSeedPoint() ; 
		for(int i = 0 ; i < this->iNumberOfStreamlines ; i++){
			draw_streamlines(vbo[i], shader, sizes[i] * 4.0 * sizeof(GLfloat));
		}
	}
} 
Beispiel #2
0
void
_DisplayFunc()
{
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

	// render the scene
    draw_streamlines(); 

	// NOTE: Call glutSwapBuffers() at the end of your display function
	glutSwapBuffers();
}
void display()
{
  glEnable(GL_DEPTH_TEST); 
  glClearColor(1,1,1,1); 
  glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); 

  glMatrixMode(GL_PROJECTION);
  glLoadIdentity(); 
  gluPerspective(60, 1, .1, 100); 

  glMatrixMode(GL_MODELVIEW); 
  glLoadIdentity(); 
  gluLookAt(0,0,5,0,0,0,0,1,0); 

  glRotatef(x_angle, 0, 1,0); 
  glRotatef(y_angle, 1,0,0); 
  glScalef(scale_size, scale_size, scale_size); 

  if (toggle_draw_streamlines == true)
    draw_streamlines(); 
  else if (toggle_animate_streamlines == true)
    animate_streamlines(); 

  glPushMatrix(); 
  glScalef(1.0, len[1]/len[0], len[2]/len[0]); 
  draw_cube(0,0,1);
  glPopMatrix(); 
  

  glBegin(GL_LINES); 
  glColor3f(1,0,0); 
  glVertex3f(0,0,0); 
  glVertex3f(1,0,0);
  glColor3f(0,1,0);  
  glVertex3f(0,0,0);
  glVertex3f(0,1,0); 
  glColor3f(0,0,1);  
  glVertex3f(0,0,0); 
  glVertex3f(0,0,1); 
  glEnd(); 


  glutSwapBuffers(); 
}
void
_DisplayFunc()
{
	//glClearColor(1,1,1,1);
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

	// render the scene
    draw_streamlines(); 


    //glPushMatrix();
    //glScalef(len[0]/len[2], len[1]/len[2], 1.f);
    //draw_cube(0,0,1);
    //glPopMatrix();


	// NOTE: Call glutSwapBuffers() at the end of your display function
	glutSwapBuffers();
}
Beispiel #5
0
void display()
{
	
	GLfloat		lightPosition[4] =  { -15.0f, -15.0f, 5.0f, 1.0f };

	glEnable(GL_DEPTH_TEST); 
	glClearColor(1,1,1,1); 
	glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); 

	glMatrixMode(GL_PROJECTION);
	glLoadIdentity(); 
	gluPerspective(60, 1, 1, 100); 


	glMatrixMode(GL_MODELVIEW); 
	glLoadIdentity(); 

	glLightfv(GL_LIGHT0, GL_POSITION, lightPosition);
	gluLookAt(0,0,5,0,0,0,0,1,0); 

	glRotatef(x_angle, 0, 1,0); 
	glRotatef(y_angle, 1,0,0); 
	glScalef(scale_size, scale_size, scale_size); 


	
	draw_streamlines();

/*	glTranslatef(0,0,-1); 
	//if (toggle_draw_streamlines == true)
	drawBounds_inner();
	glDepthMask(GL_FALSE);
	drawBounds_outter();
	glDepthMask(GL_TRUE);
 */	
	//draw_triangulation();
	// else if (toggle_animate_streamlines == true)
	// animate_streamlines(); 

	//printf(" len %f %f %f\n", len[0], len[1], len[2]); 
/*
	glPushMatrix(); 
	glScalef(1/(float)len[0], 1/(float)len[0], 1/(float)len[0]); 
	//glScalef(1/110,1/110,1/110); 
	glTranslatef(-len[0]/2.0, -len[1]/2.0, -len[2]/2.0); 

	glColor3f(1,1,1); 
	glBegin(GL_LINES); 
	glVertex3f(0,0,0); 
	glVertex3f(len[0],0,0); 
	glVertex3f(0,0,0);
	glVertex3f(0,len[1],0); 
	glVertex3f(0,0,0); 
	glVertex3f(0,0,1); 

	glVertex3f(len[0],len[1],0); 
	glVertex3f(len[0],0,0); 
	glVertex3f(len[0],len[1],0); 
	glVertex3f(0,len[1],0); 

	glEnd(); 
	glPopMatrix(); 
*/
	glutSwapBuffers(); 

}