• Advertisement
Sign in to follow this  

Crystal Ball Interface --> FPS

This topic is 1924 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi,

I currently have a crystal ball interface camera set-up where the camera is always looking at the origin and pressing left,right,up,down simply moves around the object.

I want to change this so that the camera can move around freely around the 3D environment.

I currently have two functions, LEFT and UP that have been implemented as the CB-interface I mentioned.

I want the left and right key to strafe left/right, while up/down to rise and sink the camera. How exactly would I go about changing it?

Also..what would be the proper way to move the camera forward and backward? I was thinking maybe draging the mouse could equate to moving foward/backward?


T

void Transform::left(float degrees, vec3& eye, vec3& up) {
eye = eye*rotate(degrees, up);
}


void Transform::up(float degrees, vec3& eye, vec3& up) {
vec3 ortho_axis = glm::cross(eye, up);
ortho_axis = glm::normalize(ortho_axis);

eye = eye*rotate(degrees, ortho_axis);
up = up*rotate(degrees, ortho_axis);
}

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement