コード例 #1
0
void B011001::initialize()
{
	m_Obj = gluNewQuadric();
	gluQuadricTexture(m_Obj, GL_TRUE);
	m_Earth = loadTextureBMP("EarthTexture.bmp");

	glMatrixMode(GL_MODELVIEW);	

	setProperties();

	return ;
}
コード例 #2
0
void B011001::initialize()
{
	m_Obj = gluNewQuadric();
	gluQuadricTexture(m_Obj, GL_TRUE);
	m_Earth = loadTextureBMP("EarthTexture.bmp");

	gluLookAt(0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);

	glMatrixMode(GL_MODELVIEW);	
	
//	GLfloat light_ambient[] = {0.2f, 0.2f, 0.2f, 1.0f};
//	GLfloat material_ambient[] = {0.2f, 0.2f, 0.2f, 1.0f};
//	glLightfv(GL_LIGHT1, GL_AMBIENT, light_ambient);
//	glMaterialfv(GL_FRONT, GL_AMBIENT, material_ambient);

//	GLfloat light_diffuse[] = {0.8f, 0.8f, 0.8f, 1.0f};
//	GLfloat material_diffuse[] = {0.6f, 0.6f, 0.6f, 1.0f};
//	glLightfv(GL_LIGHT1, GL_DIFFUSE, light_diffuse);
//	glMaterialfv(GL_FRONT, GL_DIFFUSE, material_diffuse);

//	GLfloat light_specular[] = {1.0f, 1.0f, 1.0f, 1.0f};
//	GLfloat material_specular[] = {1.0f, 1.0f, 1.0f, 1.0f};	
//	glLightfv(GL_LIGHT1, GL_SPECULAR, light_specular);
//	glMaterialfv(GL_FRONT, GL_SPECULAR, material_specular);

//	glMaterialf(GL_FRONT, GL_SHININESS, 100.0);

//	GLfloat light_position[] = {0.0f, 0.0f, 1.0f, 1.0f}; // 광원의 위치
//	glLightfv(GL_LIGHT1, GL_POSITION, light_position); // 광원 위치 할당

//	GLfloat light_spot_direction[] = {0.0f, 0.0f, -1.0f};
//	glLightfv(GL_LIGHT1, GL_SPOT_DIRECTION, light_spot_direction);

//	glLightf(GL_LIGHT1, GL_SPOT_CUTOFF, 10.0f);
//	glLightf(GL_LIGHT1, GL_SPOT_EXPONENT, 100.0f);

//	static GLfloat material_emission[]={0.0f, 0.0f, 0.0f, 1.0f};
//	glMaterialfv(GL_FRONT, GL_EMISSION, material_emission);

//	glLightf(GL_LIGHT1, GL_CONSTANT_ATTENUATION, 0.5f);
//	glLightf(GL_LIGHT1, GL_LINEAR_ATTENUATION, 0.1f);
//	glLightf(GL_LIGHT1, GL_QUADRATIC_ATTENUATION, 0.0f);

//	glEnable(GL_LIGHTING); // 조명 활성화
//	glEnable(GL_LIGHT1); // 1번 광원 활성화
//	glEnable(GL_COLOR_MATERIAL); // 오브젝트 자체의색 나오게 하기

	return ;
}
コード例 #3
0
/////////////////////////////////////////////////////////////////////////////
// InitGL
//	desc: initializes OpenGL
//
void CHOpenGLView::InitGL(GLvoid)
{
    glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
    glClearDepth(1.0f);
    glEnable(GL_DEPTH_TEST);
    glDepthFunc(GL_LEQUAL);
    glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);

    m_SunObject = gluNewQuadric();
    gluQuadricTexture(m_SunObject, GL_TRUE);

    glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
    glGenTextures(1, &m_SunTexture);
    glGenTextures(6, m_SpaceTexture);

    loadTextureBMP("SunTexture.bmp", &m_SunTexture);

    loadTextureBMP("SpaceTexture5.bmp", &m_SpaceTexture[0]);
    loadTextureBMP("SpaceTexture2.bmp", &m_SpaceTexture[1]);
    loadTextureBMP("SpaceTexture1.bmp", &m_SpaceTexture[2]);
    loadTextureBMP("SpaceTexture3.bmp", &m_SpaceTexture[3]);
    loadTextureBMP("SpaceTexture4.bmp", &m_SpaceTexture[4]);
    loadTextureBMP("SpaceTexture5.bmp", &m_SpaceTexture[5]);

    GLfloat light_ambient[] = { 0.1f, 0.1f, 0.1f, 1.0f };
    GLfloat light_diffuse[] = { 1.0f, 1.0f, 1.0f, 1.0f };

    GLfloat material_ambient[] = { 0.1f, 0.1f, 0.1f, 1.0f };
    GLfloat material_diffuse[] = { 0.8f, 0.8f, 0.8f, 1.0f };

    glLightfv(GL_LIGHT2, GL_AMBIENT, light_ambient);
    glLightfv(GL_LIGHT2, GL_DIFFUSE, light_diffuse);

    glMaterialfv(GL_FRONT, GL_AMBIENT, material_ambient);
    glMaterialfv(GL_FRONT, GL_DIFFUSE, material_diffuse);

    ///// 아래에 학번 클래스 멤버 함수 추가 /////

    m_B111208.initialize();

}
コード例 #4
0
void initTextures()
{
	texPlant1 = loadTextureBMP("Resources\\Textures\\grass1.bmp");
	texPlant2 = loadTextureBMP("Resources\\Textures\\grass2.bmp");
	texPlant3 = loadTextureBMP("Resources\\Textures\\grass3.bmp");

	texGrass0 = loadTextureBMP("Resources\\Textures\\blade_texture1.bmp");
	texGrass1 = loadTextureBMP("Resources\\Textures\\blade_texture2.bmp");
	texGrass2 = loadTextureBMP("Resources\\Textures\\blade_texture3.bmp");
	texGrass3 = loadTextureBMP("Resources\\Textures\\blade_texture4.bmp");
	texGrass4 = loadTextureBMP("Resources\\Textures\\blade_texture5.bmp");

	texDirt = loadTextureBMP("Resources\\Textures\\land_grass_texture.bmp");
	texTreeTrunk = loadTextureBMP("Resources\\Textures\\tree_trunk_texture3.bmp");
	texTreeLeaf = loadTextureBMP("Resources\\Textures\\leaf_texture.bmp");

	texCubeMap = loadTextureCubemapBMP("Resources\\Textures\\skybox_texture1.bmp",
		"Resources\\Textures\\skybox_texture5.bmp",
		"Resources\\Textures\\skybox_texture4.bmp",
		"Resources\\Textures\\skybox_texture3.bmp",
		"Resources\\Textures\\skybox_texture6.bmp",
		"Resources\\Textures\\skybox_texture2.bmp");

	sHeightMap = "Resources\\Heightmaps\\heightmap1.bmp";
	sTexture = "Resources\\Textures\\land_texture1.bmp";

}
コード例 #5
0
ファイル: skydome.cpp プロジェクト: LanJian/Surreal
void SkyDome::loadGradient(char* filename){
  m_gradient = loadTextureBMP(filename);
  setFog(filename);
}