• Create Account

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

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

### #1Medo3337  Members

891
Like
0Likes
Like

Posted 13 November 2012 - 08:37 PM

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, 14 November 2012 - 02:35 AM.

### #2Nik02  Members

4074
Like
0Likes
Like

Posted 14 November 2012 - 02:21 AM

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. You 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.

Niko Suni

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.