I’m building a world and I’d like to have the ground detailed much like the “HeightMap3” tutorial on gametutorials.com I follow very closely along with serveral other tutorials I found.
I can’t seem to get the detail applied to the base ground texture.
I’ve posted pictures of my two textures along with the resulting output.
screen output:
http://www.geocities.com/georgakis99/output.gif
detail texture:
http://www.geocities.com/georgakis99/detail.bmp
base texture:
http://www.geocities.com/georgakis99/grass.bmp
relevant portions of code:
</font><blockquote><font size=“1” face=“Verdana, Arial”>code:</font><hr /><pre style=“font-size:x-small; font-family: monospace;”>
#include <windows.h>
#include <iostream.h>
#include <stdio.h>
#include <math.h>
#include <glut.h>
#include “glext.h”
#include “textures.h” // just loads the .bmp
PFNGLACTIVETEXTUREARBPROC glActiveTextureARB = NULL;
PFNGLMULTITEXCOORD2FARBPROC glMultiTexCoord2fARB = NULL;
PFNGLCLIENTACTIVETEXTUREARBPROC glClientActiveTextureARB = NULL;
oid init (void)
// Initializes the gl Graphics env and the program variables.
{
// camera/viewing controls removed
loadTexture(textureArray[GROUND+1], "detail.bmp");
loadTexture(textureArray[GROUND], "grass2.bmp");
DisplayMenu();
//
// If the required extension is present, get the addresses of its
// functions that we wish to use...
//
char *ext = (char*)glGetString( GL_EXTENSIONS );
if( strstr( ext, "GL_ARB_multitexture" ) == NULL )
{
MessageBox(NULL,"GL_ARB_multitexture extension was not found",
"ERROR",MB_OK|MB_ICONEXCLAMATION);
return;
}
else
{
glActiveTextureARB = (PFNGLCLIENTACTIVETEXTUREARBPROC)wglGetProcAddress("glActiveTextureARB");
glMultiTexCoord2fARB = (PFNGLMULTITEXCOORD2FARBPROC)wglGetProcAddress("glMultiTexCoord2fARB");
glClientActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC)wglGetProcAddress("glClientActiveTextureARB");
if( !glActiveTextureARB