PDA

View Full Version : Just need some advise as to why camera isnt workin



nick2price
11-29-2008, 10:53 AM
I have gone through a load of tutorials and managed to get some code together to control a camera through the arrow keys. Everything compiles ok, the only problem is that the arrow keys dont do anything. Can someone please take a quick look and help me understand why. I am finding all this quite difficult, so i have problably done a load of stuff i dont need too, or repeated stuff between the two classes. But any help would be great,
cheers

class which creates a skybox and loads in a model car



#include "stdafx.h"
#include <GL/glut.h>
#include <windows.h>
#include <stdio.h> //for file access
#include <gl\gl.h>
#include "skybox.h"
#include "glbmp.h"
#include "coursework2.h"
#include "3dsloader.h"
#include "texture.h"

obj_type object;

bool skybox::LoadTexture(unsigned int & aTexture, const char * bitmap_file)
{
glbmp_t bitmap; //object to fill with data from glbmp


if(!glbmp_LoadBitmap(bitmap_file, 0, &amp;bitmap))
{
fprintf(stderr, "Error loading bitmap file: %s\n", bitmap_file);
}

//generate and bind the OpenGL texture
glGenTextures(1, &amp;aTexture);
glBindTexture(GL_TEXTURE_2D, aTexture);

//copy data from bitmap into texture
glTexImage2D(GL_TEXTURE_2D, 0, 3, bitmap.width, bitmap.height,
0, GL_RGB, GL_UNSIGNED_BYTE, bitmap.rgb_data);

//set up texture filtering
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);

//free the bitmap
glbmp_FreeBitmap(&amp;bitmap);

return true;
}



void skybox::Init() {

OFFSET = 1/512.0; //set offset value for skybox




LoadTexture(texture[0], "images/1.bmp");
LoadTexture(texture[1], "images/2.bmp");
LoadTexture(texture[2], "images/3.bmp");
LoadTexture(texture[3], "images/4.bmp");
LoadTexture(texture[4], "images/5.bmp");
LoadTexture(texture[5], "images/6.bmp");

}

void skybox::Init2(){



glClearColor(0.0, 0.0, 0.0, 0.0); // This clear the background color to black
glShadeModel(GL_SMOOTH); // Type of shading for the polygons


// Projection transformation
glMatrixMode(GL_PROJECTION); // Specifies which matrix stack is the target for matrix operations
glLoadIdentity(); // initialize the projection matrix as identity

glEnable(GL_DEPTH_TEST); // enable the depth test (also called z buffer)
glPolygonMode (GL_FRONT_AND_BACK, GL_FILL); // Polygon rasterization mode (polygon filled)

glEnable(GL_TEXTURE_2D); // This Enable the Texture mapping

Load3DS (&amp;object,"GTR.3ds");

object.id_texture=LoadBitmap("body.bmp"); // The Function LoadBitmap() return the current texture ID


}

void skybox::draw() {

glPushMatrix();

glColor3f(1.0f,1.0f,1.0f); //Set colour to White
glEnable(GL_TEXTURE_2D); //Enable texture mapping
glDisable (GL_DEPTH_TEST); //Disable depth testing

//before you can use a texture you have to bind it
glBindTexture(GL_TEXTURE_2D, texture[0 + text_offset]);

glBegin (GL_QUADS);

glNormal3d (0.0,0.0,1.0); glTexCoord2d (0.0 + OFFSET,0.0 + OFFSET); glVertex3d (-10.0,-10.0,10.0);
glNormal3d (0.0,0.0,1.0); glTexCoord2d (1.0 - OFFSET,0.0 + OFFSET); glVertex3d (-10.0,-10.0,-10.0);
glNormal3d (0.0,0.0,1.0); glTexCoord2d (1.0 - OFFSET,1.0 - OFFSET); glVertex3d (-10.0,10.0,-10.0);
glNormal3d (0.0,0.0,1.0); glTexCoord2d (0.0 + OFFSET,1.0 - OFFSET); glVertex3d (-10.0,10.0,10.0);

glEnd ();

glBindTexture(GL_TEXTURE_2D, texture[1 + text_offset]);
glBegin (GL_QUADS);

glNormal3d (0.0,0.0,1.0); glTexCoord2d (0.0 + OFFSET,0.0 + OFFSET); glVertex3d (-10.0,-10.0,-10.0);
glNormal3d (0.0,0.0,1.0); glTexCoord2d (1.0 - OFFSET,0.0 + OFFSET); glVertex3d (10.0,-10.0,-10.0);
glNormal3d (0.0,0.0,1.0); glTexCoord2d (1.0 - OFFSET,1.0 - OFFSET); glVertex3d (10.0,10.0,-10.0);
glNormal3d (0.0,0.0,1.0); glTexCoord2d (0.0 + OFFSET,1.0 - OFFSET); glVertex3d (-10.0,10.0,-10.0);
glEnd ();

glBindTexture(GL_TEXTURE_2D, texture[2 + text_offset]);
glBegin (GL_QUADS);

glNormal3d (0.0,0.0,1.0); glTexCoord2d (0.0 + OFFSET ,0.0 + OFFSET); glVertex3d (10.0,-10.0,-10.0);
glNormal3d (0.0,0.0,1.0); glTexCoord2d (1.0 - OFFSET ,0.0 + OFFSET); glVertex3d (10.0,-10.0,10.0);
glNormal3d (0.0,0.0,1.0); glTexCoord2d (1.0 - OFFSET ,1.0 - OFFSET); glVertex3d (10.0,10.0,10.0);
glNormal3d (0.0,0.0,10.0); glTexCoord2d (0.0 + OFFSET ,1.0 - OFFSET); glVertex3d (10.0,10.0,-10.0);

glEnd ();

glBindTexture(GL_TEXTURE_2D, texture[3 + text_offset]);
glBegin (GL_QUADS);

glNormal3d (0.0,0.0,1.0); glTexCoord2d (0.0 + OFFSET ,0.0 + OFFSET); glVertex3d (10.0,-10.0,10.0);
glNormal3d (0.0,0.0,1.0); glTexCoord2d (1.0 - OFFSET ,0.0 + OFFSET); glVertex3d (-10.0,-10.0,10.0);
glNormal3d (0.0,0.0,1.0); glTexCoord2d (1.0 - OFFSET ,1.0 - OFFSET); glVertex3d (-10.0,10.0,10.0);
glNormal3d (0.0,0.0,1.0); glTexCoord2d (0.0 + OFFSET ,1.0 - OFFSET); glVertex3d (10.0,10.0,10.0);

glEnd ();

glBindTexture(GL_TEXTURE_2D, texture[4 + text_offset]);
glBegin (GL_QUADS);

glNormal3d (0.0,0.0,1.0); glTexCoord2d (0.0 + OFFSET ,0.0 + OFFSET); glVertex3d (-10.0,-10.0,10.0);
glNormal3d (0.0,0.0,1.0); glTexCoord2d (1.0 - OFFSET ,0.0 + OFFSET); glVertex3d (10.0,-10.0,10.0);
glNormal3d (0.0,0.0,1.0); glTexCoord2d (1.0 - OFFSET ,1.0 - OFFSET); glVertex3d (10.0,-10.0,-10.0);
glNormal3d (0.0,0.0,1.0); glTexCoord2d (0.0 + OFFSET ,1.0 - OFFSET); glVertex3d (-10.0,-10.0,-10.0);

glEnd ();

glBindTexture(GL_TEXTURE_2D, texture[5 + text_offset]);
glBegin (GL_QUADS);

glNormal3d (0.0,0.0,1.0); glTexCoord2d (0.0 + OFFSET ,0.0 + OFFSET); glVertex3d (-10.0,10.0,-10.0);
glNormal3d (0.0,0.0,1.0); glTexCoord2d (1.0 - OFFSET ,0.0 + OFFSET); glVertex3d (10.0,10.0,-10.0);
glNormal3d (0.0,0.0,1.0); glTexCoord2d (1.0 - OFFSET ,1.0 - OFFSET); glVertex3d (10.0,10.0,10.0);
glNormal3d (0.0,0.0,1.0); glTexCoord2d (0.0 + OFFSET ,1.0 - OFFSET); glVertex3d (-10.0,10.0,10.0);

glEnd ();

//Re-Enable the depth test
glEnable(GL_DEPTH_TEST);
//disable texture mapping
glDisable(GL_TEXTURE_2D);
glPopMatrix();


}

void skybox::draw_car(void){

int l_index;

glMatrixMode(GL_MODELVIEW); // Modeling transformation
glLoadIdentity(); // Initialize the model matrix as identity

glBindTexture(GL_TEXTURE_2D, object.id_texture); // set the active texture

glBegin(GL_TRIANGLES);
for (l_index=0;l_index<object.polygons_qty;l_index++)
{
//----------------- FIRST VERTEX -----------------
// Texture coordinates of the first vertex
glTexCoord2f( object.mapcoord[ object.polygon[l_index].a ].u,
object.mapcoord[ object.polygon[l_index].a ].v);
// Coordinates of the first vertex
glVertex3f( object.vertex[ object.polygon[l_index].a ].x,
object.vertex[ object.polygon[l_index].a ].y,
object.vertex[ object.polygon[l_index].a ].z); //Vertex definition

//----------------- SECOND VERTEX -----------------
// Texture coordinates of the second vertex
glTexCoord2f( object.mapcoord[ object.polygon[l_index].b ].u,
object.mapcoord[ object.polygon[l_index].b ].v);
// Coordinates of the second vertex
glVertex3f( object.vertex[ object.polygon[l_index].b ].x,
object.vertex[ object.polygon[l_index].b ].y,
object.vertex[ object.polygon[l_index].b ].z);

//----------------- THIRD VERTEX -----------------
// Texture coordinates of the third vertex
glTexCoord2f( object.mapcoord[ object.polygon[l_index].c ].u,
object.mapcoord[ object.polygon[l_index].c ].v);
// Coordinates of the Third vertex
glVertex3f( object.vertex[ object.polygon[l_index].c ].x,
object.vertex[ object.polygon[l_index].c ].y,
object.vertex[ object.polygon[l_index].c ].z);
}
glEnd();



}


main class which calls up my skymap and car


#include "stdafx.h"
#include <GL/glut.h>
#include <windows.h>
#include <stdio.h> //for file access
#include <gl\gl.h>
#include "skybox.h"
#include "glbmp.h"
#include "coursework2.h"
#include "3dsloader.h"
#include "texture.h"

int screen_width=800;
int screen_height=600;

skybox aSkyBox;

double rotation_x=0, rotation_x_increment=0.1;
double rotation_y=0, rotation_y_increment=0.05;
double rotation_z=0, rotation_z_increment=0.03;

// Flag for rendering as lines or filled polygons
int filling=1; //0=OFF 1=ON

GLvoid ReSizeGLScene(GLsizei width, GLsizei height) {

if (height<=0) { height=1; }

glViewport(0,0,width,height);

glMatrixMode(GL_PROJECTION);
glLoadIdentity();

gluPerspective(45.0f,(GLfloat)width/(GLfloat)height,0.1f,100.0f);

glMatrixMode(GL_MODELVIEW);
glutPostRedisplay ();
}

int InitGL(GLvoid) {

glEnable(GL_TEXTURE_2D);
glShadeModel(GL_SMOOTH); //Try GL_FLAT to see the difference
glClearColor(0.0f, 0.0f, 0.0f, 1.0f); //Background colour
glClearDepth(1.0f);
glEnable(GL_DEPTH_TEST); //Enables depth testing
glDepthFunc(GL_LEQUAL); //Specifies how Depth testing is done
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); //Affects quality of colour and texture interpolation
glFrontFace (GL_CCW); //Specifies that the front of a face is defined
//in a Counter Clockwise manner
glCullFace(GL_BACK); //Specifies that the back of faces are not shown
//so OpenGL does not need to draw things twice
glEnable(GL_CULL_FACE); //Enables culling of faces


aSkyBox.Init(); //Initalize the Skybox
aSkyBox.Init2();

return TRUE;
}


void keyboard_s (int key, int x, int y)
{
switch (key)
{
case GLUT_KEY_UP:
rotation_x_increment = rotation_x_increment +0.005;
break;
case GLUT_KEY_DOWN:
rotation_x_increment = rotation_x_increment -0.005;
break;
case GLUT_KEY_LEFT:
rotation_y_increment = rotation_y_increment +0.005;
break;
case GLUT_KEY_RIGHT:
rotation_y_increment = rotation_y_increment -0.005;
break;
}
}

void display(void) {

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glTranslatef(0.0,0.0,-10); // We move the object 50 points forward (the model matrix is multiplied by the translation matrix)

rotation_x = rotation_x + rotation_x_increment;
rotation_y = rotation_y + rotation_y_increment;
rotation_z = rotation_z + rotation_z_increment;

if (rotation_x > 359) rotation_x = 0;
if (rotation_y > 359) rotation_y = 0;
if (rotation_z > 359) rotation_z = 0;

glRotatef(rotation_x,1.0,0.0,0.0); // Rotations of the object (the model matrix is multiplied by the rotation matrices)
glRotatef(rotation_y,0.0,1.0,0.0);
glRotatef(rotation_z,0.0,0.0,1.0);

aSkyBox.draw();
//aSkyBox.draw_car();
glFlush();
glutSwapBuffers();

}


int main(int argc, char **argv)
{
glutInit(&amp;argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowSize(screen_width,screen_height);
glutInitWindowPosition(0,0);
glutCreateWindow("Coursework 2");

glutReshapeFunc(ReSizeGLScene);
glutDisplayFunc(display);
glutSpecialFunc (keyboard_s);
InitGL();
glutMainLoop();

return(0);
}


thanks again

trinitrotoluene
11-29-2008, 11:21 AM
In your keyboard function you lack at least calls for glutPostRedisplay (http://www.opengl.org/documentation/specs/glut/spec3/node20.html#SECTION00055000000000000000)() to refresh the screen after user input.

nick2price
11-29-2008, 11:50 AM
correct again as usual. That works really kool now. I still have one problem you might be able to see why in my code, but i still cannot see my car model. It does not seem to be in the skybox. How would i achieve this? I have been trying this for a while but still cant work it out.
cheers

trinitrotoluene
11-29-2008, 01:43 PM
What I would do is
1)Inspect the model file if it's human readable (If not I use Blender (http://www.blender.org/),it's free) to verify and estimate the model properties (position,orientation,scale etc).

2) Then I estimate parameters to give for the projection matrix (Field of view big enough to view the entire model) and model view matrix (to put the model in front of the camera) for debugging purpose. In case you cannot read the the model file and don't want to use a 3D modeler, use an orthogonal projection matrix with a large field of view glOrtho(-1000,1000,-1000,1000,-1000,1000);. Modify it by iteration until you have a good estimate of the properties of you r model.

3) Make a very simple sample program so I can test the parameters of the projection,model view matrix and drawing command to view the model alone.

4) Finally determinate if the model and/or other objects beside (a sky box for example) need scaling (glScalef), translation(glTranslatef),rotation(glRotatef) to be able to view it. Find if the object is not clipped by the near clipping plane.

After that, you should be able to view your model inside your entire scene. Remember that the black screen syndrome is a very common disease when you don't know the transform properties of your objects.

nick2price
11-29-2008, 02:31 PM
I am downloading blender so i can find out the model properties. In the meantime, i have another program which displays this car just in a screen doing some rotating. This program works fine but maybe there is somthing in there which could tell me what i need to do in my main program.

#include "stdafx.h"
#include <windows.h>
#include <GL/glut.h>
#include "coursework2.h"
#include "texture.h"
#include "3dsloader.h"


int screen_width=640;
int screen_height=480;

int filling=1; //0=OFF 1=ON


obj_type object;

void init(void)
{
glClearColor(0.0, 0.0, 0.0, 0.0); // This clear the background color to black
glShadeModel(GL_SMOOTH); // Type of shading for the polygons


// Projection transformation
glMatrixMode(GL_PROJECTION); // Specifies which matrix stack is the target for matrix operations
glLoadIdentity(); // initialize the projection matrix as identity
gluPerspective(45.0f,(GLfloat)screen_width/(GLfloat)screen_height,10.0f,10000.0f); // define the "viewing volume"

glEnable(GL_DEPTH_TEST); // enable the depth test (also called z buffer)
glPolygonMode (GL_FRONT_AND_BACK, GL_FILL); // Polygon rasterization mode (polygon filled)

glEnable(GL_TEXTURE_2D); // This Enable the Texture mapping

Load3DS (&amp;object,"GTR.3ds");

object.id_texture=LoadBitmap("body.bmp"); // The Function LoadBitmap() return the current texture ID


}



void display(void)
{
int l_index;

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_MODELVIEW); // Modeling transformation

glLoadIdentity(); // Initialize the model matrix as identity

glTranslatef(0.0,0.0,-200);

glBindTexture(GL_TEXTURE_2D, object.id_texture); // set the active texture

glBegin(GL_TRIANGLES);
for (l_index=0;l_index<object.polygons_qty;l_index++)
{
//----------------- FIRST VERTEX -----------------
// Texture coordinates of the first vertex
glTexCoord2f( object.mapcoord[ object.polygon[l_index].a ].u,
object.mapcoord[ object.polygon[l_index].a ].v);
// Coordinates of the first vertex
glVertex3f( object.vertex[ object.polygon[l_index].a ].x,
object.vertex[ object.polygon[l_index].a ].y,
object.vertex[ object.polygon[l_index].a ].z); //Vertex definition

//----------------- SECOND VERTEX -----------------
// Texture coordinates of the second vertex
glTexCoord2f( object.mapcoord[ object.polygon[l_index].b ].u,
object.mapcoord[ object.polygon[l_index].b ].v);
// Coordinates of the second vertex
glVertex3f( object.vertex[ object.polygon[l_index].b ].x,
object.vertex[ object.polygon[l_index].b ].y,
object.vertex[ object.polygon[l_index].b ].z);

//----------------- THIRD VERTEX -----------------
// Texture coordinates of the third vertex
glTexCoord2f( object.mapcoord[ object.polygon[l_index].c ].u,
object.mapcoord[ object.polygon[l_index].c ].v);
// Coordinates of the Third vertex
glVertex3f( object.vertex[ object.polygon[l_index].c ].x,
object.vertex[ object.polygon[l_index].c ].y,
object.vertex[ object.polygon[l_index].c ].z);
}
glEnd();

glFlush(); // This force the execution of OpenGL commands
glutSwapBuffers();
}

int main(int argc, char **argv)
{
glutInit(&amp;argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowSize(screen_width,screen_height);
glutInitWindowPosition(0,0);
glutCreateWindow("Coursework 2");

glutDisplayFunc(display);
glutIdleFunc(display);
init();
glutMainLoop();

return(0);
}

I will try and find out the models properties

right, think i have it, this is the properties of the car from blender
LocX: 0.000
LocY: -0.039
LocZ: 0.000

scaleX: 0.100
scaleY: 0.100
scaleZ: 0.100

rotaion all 0.000

DimX: 2.359
DimY: 5.583
DimZ: 1.699

I hope these are the right propeties

trinitrotoluene
11-29-2008, 03:17 PM
Ok, Blender give interesting value.



LocX: 0.000
LocY: -0.039
LocZ: 0.000

This give the position of the origin of your model, not it center.



scaleX: 0.100
scaleY: 0.100
scaleZ: 0.100

This mean blender applied a 0.1 scale value for each x,y,z.



DimX: 2.359
DimY: 5.583
DimZ: 1.699

This appear to be the bounding box size with blender scale applied.So when you draw your object in OpenGL without scale, the bounding box of your object is DimX: 23.59 DimY: 55.83 and DimZ: 16.99.

Now, what is the size of your sky box?

trinitrotoluene
11-29-2008, 03:29 PM
The size of your sky box is (20,20,20) which is smaller than your car model. So when you draw your car do the following:


glPushMatrix();
glScalef(0.1,0.1,0.1);
draw_car();
glPopMatrix();


If your camera is well positioned, you will see your entire car.

Edit: Important, in your draw_car function, remove the glLoadIdentity() call because this will void all previous transformation, scaling included.

nick2price
11-29-2008, 04:20 PM
Still very strange, so i removed the glLoadIdentity() from my draw_car method and then in my main class my display has been changed too


void display(void) {

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glTranslatef(0.0,0.0,-10);

rotation_x = rotation_x + rotation_x_increment;
rotation_y = rotation_y + rotation_y_increment;
rotation_z = rotation_z + rotation_z_increment;

if (rotation_x > 359) rotation_x = 0;
if (rotation_y > 359) rotation_y = 0;
if (rotation_z > 359) rotation_z = 0;

glRotatef(rotation_x,1.0,0.0,0.0); // Rotations of the object (the model matrix is multiplied by the rotation matrices)
glRotatef(rotation_y,0.0,1.0,0.0);
glRotatef(rotation_z,0.0,0.0,1.0);

aSkyBox.draw();
glFlush();
glutSwapBuffers();

glPushMatrix();
glScalef(0.1,0.1,0.1);
aSkyBox.draw_car();
glPopMatrix();

}


There still seems to be no car, and i rotated the camera around the skybox a few times just to double check. Is there anything else i could try?
cheers

trinitrotoluene
11-29-2008, 04:54 PM
Look inside your display function:


aSkyBox.draw();
glFlush();
glutSwapBuffers();

glPushMatrix();
glScalef(0.1,0.1,0.1);
aSkyBox.draw_car();
glPopMatrix();


You draw your car after glutSwapBuffers. The probability that you will see your car is 0%.

nick2price
11-29-2008, 05:58 PM
Well, good news, the car is now displayed, bad news it has no texture for some reason. I cant see anything different i have from my other program. Just trying to figure out the problem. Is it ok too have two inits like

void skybox::Init() {

OFFSET = 1/512.0; //set offset value for skybox




LoadTexture(texture[0], "images/1.bmp");
LoadTexture(texture[1], "images/2.bmp");
LoadTexture(texture[2], "images/3.bmp");
LoadTexture(texture[3], "images/4.bmp");
LoadTexture(texture[4], "images/5.bmp");
LoadTexture(texture[5], "images/6.bmp");

}

void skybox::Init2(){



glClearColor(0.0, 0.0, 0.0, 0.0); // This clear the background color to black
glShadeModel(GL_SMOOTH); // Type of shading for the polygons


// Projection transformation
glMatrixMode(GL_PROJECTION); // Specifies which matrix stack is the target for matrix operations
glLoadIdentity(); // initialize the projection matrix as identity

glEnable(GL_DEPTH_TEST); // enable the depth test (also called z buffer)
glPolygonMode (GL_FRONT_AND_BACK, GL_FILL); // Polygon rasterization mode (polygon filled)

glEnable(GL_TEXTURE_2D); // This Enable the Texture mapping

Load3DS (&amp;object,"GTR.3ds");

object.id_texture=LoadBitmap("body.bmp"); // The Function LoadBitmap() return the current texture ID


}

and then too call them both up in my main like

int InitGL(GLvoid) {

glEnable(GL_TEXTURE_2D);
glShadeModel(GL_SMOOTH); //Try GL_FLAT to see the difference
glClearColor(0.0f, 0.0f, 0.0f, 1.0f); //Background colour
glClearDepth(1.0f);
glEnable(GL_DEPTH_TEST); //Enables depth testing
glDepthFunc(GL_LEQUAL); //Specifies how Depth testing is done
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); //Affects quality of colour and texture interpolation
glFrontFace (GL_CCW); //Specifies that the front of a face is defined
//in a Counter Clockwise manner
glCullFace(GL_BACK); //Specifies that the back of faces are not shown
//so OpenGL does not need to draw things twice
glEnable(GL_CULL_FACE); //Enables culling of faces


aSkyBox.Init(); //Initalize the Skybox
aSkyBox.Init2();

return TRUE;
}

One of them is for the skymap and one for the car. I am not sure if this is legal though?

trinitrotoluene
11-29-2008, 06:20 PM
Is it ok too have two inits

It should not cause problem if the first init function do not depend of the second.



Well, good news, the car is now displayed, bad news it has no texture for some reason. I cant see anything different i have from my other program.

Is your texture image properly loaded, properly binded etc? Try to display the texture on a simple quad. Maybe you have just a small typo error somewhere.