OpenGL 4.3 setting camera LookAt

I have a scene with a camera that I want to look down on a floor that has objects on it. I'm having trouble setting the position of the camera so that I can see the floor from above.

I have:

camera->setPosition(vec3(20.0f, 1.5f, 0.0f));

I would like to be able to zoom out more.
bbooAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Member_2_5069294Commented:
In most graphics systems Y is up. I assume that your objects are at, or near the origin. So to move your camera further above the object you would do something like this:
camera->setPosition(vec3(0.0f, 10.f, 0.0f));

Open in new window

That places it 10 units above the origin. To see more of the floor you would move it further up (always assuming its a perspective camera). The other aspect is that it has to be looking downwards. An OpenGL camera looks down its z-axis, so you have to rotate it to point its z-axis down.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Game Programming

From novice to tech pro — start learning today.