How to create a new class an how to use the camera

Hello! Its the first time i am posting here and one of the first days i am trying to do something with OF. How can i make a new class? + i cant understand how this odd camera effect is being created. Are there any tutorials?

This is my code on testapp.ccp:

#include “testApp.h”

GLfloat x[1000000];// = {-40.0, 40, 100.0, 0.0};
GLfloat y[1000000];// = {0.99, 0.99, 0.99, 1.0};
GLfloat yp[1000000];// = {0.99, 0.99, 0.99, 1.0};
GLfloat z[1000000];

GLfloat xm[1000000];// = {-40.0, 40, 100.0, 0.0};
GLfloat ym[1000000];// = {0.99, 0.99, 0.99, 1.0};
GLfloat zm[1000000];

GLfloat cr[1000000];
GLfloat cg[1000000];
GLfloat cb[1000000];

GLfloat xm_u[1000000];
GLfloat zm_u[1000000];
GLfloat megethos_mountains[1000000];

int h_m_x = 70; //how_many_particles per stair
int h_m_y = 70; // how many stairs
int h_m_a = h_m_x * h_m_y; //how_many_all
float d = 30; //distance between
int h_m_mountains;

float t;
float t_speed = 0.01;;

//--------------------------------------------------------------
void testApp::setup(){
//new_rock = new rock(20);
ofBackground(30,30,30);
int a = 0;
float b = 0;
for(int i = 1;i<=h_m_a;i++){
z[i] = a*d;
x[i] = +b;
cr[i] = 127;//ofRandom(0,30);
cg[i] = 255;//ofRandom(0,30);
cb[i] = 212;
if(a>=h_m_x){
a=0; b = b + d;
}
if(ofRandom(0,10)>9.8){y[1] = ofRandom(10,20);}else{y[1] = ofRandom(0,10);}
}
void testApp::camera (){

gluPerspective ( 0, 1, 0, 5000 );
glMatrixMode(GL_PROJECTION);

float r = 2500;
//glRotatef(mouseX, 0.f, 1.f, 0.f);
gluLookAt (h_m_x*d/2+r*sin(t),-2500,h_m_x*d/2+r*cos(t), h_m_x*d/2,0,h_m_x*d/2, 0,-1,0 );
t = t + t_speed;
}

thank you very much!

I think the odd camera thing occurs due to the fact that i do not draw the rects from back to the front. My camera rotates around it so how could i do this? thanks again!