Jump to content
  • Advertisement
Josheir

Gameplay What are Some Real Game/Simulator Examples that Use Rotation Around a Point?

Recommended Posts

I'm having a great time with the OpenGL.  I have a question though, what sorts of ways can the glm::lookAt command be used in simulators and games.  As I am understanding, this command allows us to rotate around a point and look inward.  Could I have some real life (diverse) game/simulator descriptions or captured game/simulator images, please?  

Thank You,

Josheir

Share this post


Link to post
Share on other sites
Advertisement
34 minutes ago, Josheir said:

Could I have some real life (diverse) game/simulator descriptions or captured game/simulator images, please?  

Example is about anything that you can see on any 3D game. LookAt mainly used to convert camera frame (basis) that used for navigating camera into world to view matrix that used for rendering.

Edited by Fulcrum.013

Share this post


Link to post
Share on other sites

Oh, okay,  There are many questions on the internet asking about rotation around a point.  I was wondering what the idea is.  Say there is a tower in a 3d game, one could use a keypress to rotate around it , perhaps?

Thanks, Flucrum.013,

Josheir

Share this post


Link to post
Share on other sites

A very specific example would be having a camera in a 3D game following a player and LookAt the player's coordinates to calculate the new rotation/etc...  Or LookAt whatever it is the player is clicking on/etc... 

Share this post


Link to post
Share on other sites
2 minutes ago, Josheir said:

Say there is a tower in a 3d game, one could use a keypress to rotate around it , perhaps?

You have to use a local rotation for tower, or/and frames tree to rotate turret respectively to its base, not to world basis 

Share this post


Link to post
Share on other sites

And I think you may have it confused, it's not rotating anything.  It's creating a viewing matrix based on an origin(eye) position, the(center) position of the Looked At, and the Up vector of the(eye).  This can be used to rotate your view towards the (center) point.  If I'm not reading the docs wrong. ;)

* to rotate your "view" or any "object" in your scene.

Share this post


Link to post
Share on other sites
1 minute ago, Septopus said:

This can be used to rotate your view towards the (center) point. 

Really view transform is rotation of world in direction backward then actual camera rotation. So of cource it can be used to some triks with rotations, that allow to set a z axe of basis looking to given point, but personally im prefer to use custom made lookTo function that works similar but perform a just a rotation instead inversed to calculate positions of basis.

Share this post


Link to post
Share on other sites

Yeah, you are right...  I read it wrong.. haha.  So you could use it for what I was saying but you would have to invert it... 

Share this post


Link to post
Share on other sites

Well, I dunno now..  this seems to be saying I was right.

from: https://open.gl/transformations

"To create the view transformation, GLM offers the useful glm::lookAt function that simulates a moving camera. The first parameter specifies the position of the camera, the second the point to be centered on-screen and the third the up axis. Here up is defined as the Z axis, which implies that the XY plane is the 'ground'."

But this is not my area of expertise, so I will leave you with that. ;)  Hope it helps somehow.

Edited by Septopus

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!