Game Development Community

Camera smoothing

by Ben Mathis · in Torque Game Engine · 05/30/2007 (8:59 am) · 6 replies

I'm posting on behalf of my programmer, so forgive the naive nature of this question. He is about to start working on the camera for our game. We want it to be a 3rd person camera that views the character from the side, and keeps the character in the center, but that smooths in and out so that it isn't jerky when following quick movements.

So my question is, what part of the code should he start working with for this? Is there a specific file he needs to open and work on? And are there any camera related threads that would be helpful for me to point him to?

Thanks!

-Ben

#1
05/30/2007 (10:18 am)
Before I answer, I have to know...why doesn't your programmer post the question in the forums? He might be able to better explain what he's already looked and and where he plans on starting, as well as what mods he wants to perform.
#2
05/30/2007 (11:21 am)
Hi Ben,

Your programmer should look at these files . . .

engine\game\camera.cc
engine\game\camera.h
engine\game\cameraSpline.cc
engine\game\cameraSpline.h

Those should get him started. There are a number of good threads and resources on the subject as well. One of the most popular code add-ons can be found here . . .

www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5471

I'm not sure how well it works with the latest TGE 1.5.2 code, but it is a popular resource that has gone through a number of revisions as Torque has matured.

I hope that helps.
#3
05/30/2007 (1:33 pm)
There is a camera offset that is coded in the engine, maybe if he either changes the offset or expose the offset so he could modify it via script
#4
05/30/2007 (2:34 pm)
Aaron beat me to the posting of the link. It should be reiterated, reading over the advanced camera resource is one of the best ways to familiarize someone with the camera system.
#5
05/31/2007 (2:51 pm)
Thanks guys, I appreciate the advice and links.

Michael Perry: I'm the more active forum guy, and I have time during the day to post, whereas he does not, so I was trying to get a head start with info to give him.
#6
06/01/2007 (1:36 am)
I'm not sure if I understand this correctly... But can't you just move the cam node in the model to the side of the character? Then in the scripts use the use cameraLag variable to do the smoothing?