예제 #1
0
void MCMesh::cb_initGL()
{
	Geom::Vec4f colClear(0.2f, 0.2f, 0.2f, 0.1f);
	Geom::Vec4f colDif(0.8f, 0.9f, 0.7f, 1.0f);
	Geom::Vec4f colSpec(0.9f, 0.9f, 0.9f, 1.0f);

	m_render = new Algo::Render::GL2::MapRender();

	m_positionVBO = new Utils::VBO();
	m_flatShader = new Utils::ShaderFlat();
	m_flatShader->setAttributePosition(m_positionVBO);
	m_flatShader->setAmbiant(colClear);
	m_flatShader->setDiffuse(colDif);
	m_flatShader->setExplode(1.0f);

	//m_simpleColorShader = new Utils::ShaderSimpleColor();
	//m_simpleColorShader->setAttributePosition(m_positionVBO);

	m_linesShader = new Utils::ShaderBoldLines();
	m_linesShader->setAttributePosition(m_positionVBO);

	registerShader(m_flatShader);
//	registerShader(m_simpleColorShader);
	registerShader(m_linesShader);

	m_dr = new Utils::Drawer();
	m_dr->newList();
	m_dr->pointSize(4.0f);
	m_dr->lineWidth(25.0f);
	m_dr->begin(GL_LINES);
	m_dr->color3f(1.0,0.0,0.0);
	m_dr->vertex3f(15.0,15.0,65.0);
	m_dr->vertex3f(110.0,110.0,65.0);
	m_dr->color3f(0.0,1.0,0.0);
	m_dr->vertex3f(110.0,15.0,75.0);
	m_dr->vertex3f(15.0,110.0,75.0);
	m_dr->end();
	m_dr->endList();

}
예제 #2
0
파일: mcmesh.cpp 프로젝트: codistmonk/CGoGN
void MCMesh::cb_initGL()
{
	Geom::Vec4f colClear(0.2f, 0.2f, 0.2f, 0.1f);
	Geom::Vec4f colDif(0.8f, 0.9f, 0.7f, 1.0f);
	Geom::Vec4f colSpec(0.9f, 0.9f, 0.9f, 1.0f);

	Utils::GLSLShader::setCurrentOGLVersion(2);

	m_render = new Algo::Render::GL2::MapRender();

	m_positionVBO = new Utils::VBO();
	m_flatShader = new Utils::ShaderFlat();
	m_flatShader->setAttributePosition(m_positionVBO);
	m_flatShader->setAmbiant(colClear);
	m_flatShader->setDiffuse(colDif);
	m_flatShader->setExplode(1.0f);

	m_simpleColorShader = new Utils::ShaderSimpleColor();
	m_simpleColorShader->setAttributePosition(m_positionVBO);

	registerShader(m_flatShader);
	registerShader(m_simpleColorShader);
}