Hey guys
I am quite crap at maths and have a little bit of coding experience(in other words i dont really know what im at). Im using the skybox code from the gametutorials.com site (im sure many of you are familiar with it) as a basis for a simple game i am trying to create.however ive run into a wee problem. Im trying to get a 2d overlay to be displayed on the screen no matter where the mouse is pointed(sort of like where the health is displayed in quake 1). the following code seems to work for strafing but will not work when i move the mouse.It seems to rotate around the object instead. Please could someone help me to figure this out… I realise that the texture is horizontal instead of vertical(i know how to fix this,its not exactly genius stuff)
here is my method :
(texture square3 is in init)
void CreateBorder(float x,float y,float z, float width, float height, float length){
// x = x - width /2;
// y = y - height /2;
// z = z - length /2;
glBindTexture(GL_TEXTURE_2D, g_Texture[Square3]);
glBegin(GL_QUADS);
// Assign the texture coordinates and vertices for the BOTTOM Side
glTexCoord2f(1.0f, 0.0f); glVertex3f(x, y, z);
glTexCoord2f(1.0f, 1.0f); glVertex3f(x, y, z + length);
glTexCoord2f(0.0f, 1.0f); glVertex3f(x + width, y, z + length);
glTexCoord2f(0.0f, 0.0f); glVertex3f(x + width, y, z);
glEnd();
}
and i call this in my render method :
CreateBorder(g_Camera.m_vView.x,g_Camera.m_vView.y,g_Camera.m_vView.z,20,10,10);
/////////////////////
Ive heard something about changing to ortho and then back again but when i tried it i could see the rest of my 3d scene for a milisecond followed by blackness. If anyone knows how to do this could they please help me…thanks