Sorry, I am a bad blogger always had anyway here is my summatiion for graphics
[code]
void drawModel(objModel_p shape)
{
//put a new matrix on the stack to operate on
glPushMatrix();
//go to return to world space
glTranslatef(shape->center.x, shape->center.y , shape->center.z);
//move to new pos
glTranslatef(shape->position.x, shape->position.y ,shape->position.z);
//scale in local space
glScalef(shape->scale.x,shape->scale.y, shape->scale.z);
//rotate in local space
glRotatef(shape->rotation, 0, 1, 0);
//go to local space
glTranslatef(-shape->center.x, -shape->center.y , -shape->center.z);
//send verts thru that maxtix backwards.
glmDraw(shape->model, GLM_SMOOTH| GLM_TEXTURE);
//remove new matrix and return to worldspace
glPopMatrix();
}
[/code]
No comments:
Post a Comment