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

Started by
12 comments, last by zircher 5 years, 5 months ago

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

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.

#define if(a) if((a) && rand()%100)

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

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

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 

#define if(a) if((a) && rand()%100)

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.

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.

#define if(a) if((a) && rand()%100)

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

What is a frame tree?

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.

This topic is closed to new replies.

Advertisement