About Store Forum Documentation Contact



Post Reply 
Cam.setSpherical() to Cam.setFromAt()
Author Message
Kiekos Offline
Member

Post: #1
Cam.setSpherical() to Cam.setFromAt()
Hey!

I'm close to finishing the whole camera handling in my game and the last thing to do is smooth transition from camera which is set spherical around the player to camera which is set from a certain position next to the player. This image should clear things up:

[Image: nnf3MzK.png]

I would like to do something like this:
Code:
current_cam_pos = Lerp(current_cam_pos, desired_cam_pos, step);
current_cam_at = Lerp(current_cam_at, desired_cam_at, step);

Cam.setFromAt(current_cam_pos, current_cam_at);

The problem is... I can't get it working as there is no function to get camera's position straight off. I mean that when camera is set spherical its position is described by: position (center of the sphere), dist and pitch.

If I could somehow calculate what its posistion is at a certain moment, I could do the smooth transition I came up with!

Thanks,
Kiekos
11-28-2013 03:34 PM
Find all posts by this user Quote this message in a reply
SamNainocard Offline
Member

Post: #2
RE: Cam.setSpherical() to Cam.setFromAt()
Not quite understand the questions.

Do you mean getting camera's position using Cam.matrix.pos?
(This post was last modified: 11-29-2013 09:14 AM by SamNainocard.)
11-29-2013 09:13 AM
Find all posts by this user Quote this message in a reply
Kiekos Offline
Member

Post: #3
RE: Cam.setSpherical() to Cam.setFromAt()
That's probably it... I'm gonna check in a sec and let you know. Thanks!

EDIT: Yep, works! There's one more thing I still don't know... Why did I put this thread in graphics forum? It shouldn't be here grin
(This post was last modified: 11-29-2013 08:30 PM by Kiekos.)
11-29-2013 01:57 PM
Find all posts by this user Quote this message in a reply
Post Reply