lighting.attach(0, light);
camera.set_up_direction(GL::Vector3(0, 0, 1));
- camera.set_position(GL::Vector3(distance, 0, 0));
- camera.look_at(GL::Vector3(0, 0, 0));
+ update_camera();
}
Viewer::~Viewer()
float cp = cos(pitch);
float sp = sin(pitch);
camera.set_position(GL::Vector3(-cy*cp*distance, -sy*cp*distance, -sp*distance));
+ camera.set_depth_clip(distance*0.02, distance*50);
camera.look_at(GL::Vector3(0, 0, 0));
}
float sy = sin(light_yaw);
float cp = cos(light_pitch);
float sp = sin(light_pitch);
- light.set_position(GL::Vector4(-cy*cp, -sy*cp, -sp));
+ light.set_position(GL::Vector4(-cy*cp, -sy*cp, -sp, 0));
}