# Camera looking at the same point the mesh is looking at

## Recommended Posts

Medo Mex    891
CORRECTION: How do I make a mesh look at the same point the camera is looking at?

Basically, I want to change the mesh rotation to make it look at the same point the camera is looking at. Edited by Medo3337

##### Share on other sites
Nik02    4348
Assuming I understood your intent correctly, you can use atan2 to find an angle given x and y coordinates (of the point). You would then use this angle to rotate the mesh. For true 3d rotation, things become a bit more difficult, but you could use quaternions or two separate rotation planes for the same effect.

Aside from that, a "camera" (in context of computer graphics) usually "looks" along an infinite line as specified by the view and projection transformation. The view transform is usually calculated given an "eye point" and a "lookat point", though, which I assume you have already.

Also note that a mesh, being just a soup of geometry, does not intrinsically "look at" in any direction. [b]You [/b]are the one who defines the logical orientation of the mesh; that is, which direction is "forward", "up" etc. The computer could not care less if the mesh happens to portray a model of a human, animal or other physical entity.