TEXTURE MAPPING
2016-08-23
0 0 0
no vote
Other
Earn points
#include
#include
#include
#include "SOIL.h"
GLUquadricObj*pBumi;
GLuinttexture;
GLuinttex_2d;
GLfloatz_pos = -3.0f;
GLfloatrot = 0.0f;
GLuintLoadGLTexture(const char*filename)
{
// load an image file directly as a new OpenGL texture
tex_2d= SOIL_load_OGL_texture(filename, SOIL_LOAD_AUTO, SOIL_CREATE_NEW_ID,
SOIL_FLAG_INVERT_Y);
// check for an error during the load process
if(tex_2d== 0) {
printf("SOIL loading error: '%s'\n", SOIL_last_result());
}
return tex_2d;
}
voidinit(void)
{
texture= LoadGLTexture("bumi.bmp");
glEnable(GL_TEXTURE_2D);
glShadeModel(GL_SMOOTH);
glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
pBumi= gluNewQuadric();
gluQuadricNormals(pBumi, GLU_SMOOTH);
gluQuadricTexture(pBumi, GL_TRUE);
}
voidrenderScene(void)
{
glClear(GL_COLOR_BUFFE
#include
#include
#include "SOIL.h"
GLUquadricObj*pBumi;
GLuinttexture;
GLuinttex_2d;
GLfloatz_pos = -3.0f;
GLfloatrot = 0.0f;
GLuintLoadGLTexture(const char*filename)
{
// load an image file directly as a new OpenGL texture
tex_2d= SOIL_load_OGL_texture(filename, SOIL_LOAD_AUTO, SOIL_CREATE_NEW_ID,
SOIL_FLAG_INVERT_Y);
// check for an error during the load process
if(tex_2d== 0) {
printf("SOIL loading error: '%s'\n", SOIL_last_result());
}
return tex_2d;
}
voidinit(void)
{
texture= LoadGLTexture("bumi.bmp");
glEnable(GL_TEXTURE_2D);
glShadeModel(GL_SMOOTH);
glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
pBumi= gluNewQuadric();
gluQuadricNormals(pBumi, GLU_SMOOTH);
gluQuadricTexture(pBumi, GL_TRUE);
}
voidrenderScene(void)
{
glClear(GL_COLOR_BUFFE
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