Game Development Community

Camera zoom

by Shiraz · in Torque X 2D · 04/17/2007 (8:35 pm) · 6 replies

This is an easy one. How do I zoom the camera? I can move it around and rotate it but zoom is eluding me.

#1
04/18/2007 (7:25 am)
There's no direct zoom factor, but you just set the extent of the camera:

void SetCameraZoom(float zoom) {
_camera.Extent = _defaultCameraExtent * zoom;
}

If you want to achieve a smooth zoom effect, you might have to experiment a bit how fast to change it..
#2
04/26/2007 (1:52 am)
In the next release of Torque X after 1.0 there will be fully functional camera zoom built into T2DSceneCamera. That version also has methods to automate the animation of zoom, rotation, and position of the camera. Until then, Matias' suggestion should work fine.
#3
04/26/2007 (2:58 am)
Nice, thumbs up :)
#4
05/16/2007 (8:27 am)
I can't remember what the actual name for this is but in TGB you can set the camera "stickyness" so that moving when the object the camera was looking at, it would sort of "pull" the camera around and then the camera would catch up afterwards... this was a cool feature for fast acceleration etc...

Can this be done in TXE or are there plans to impliment this kind of behaviour?
#5
05/20/2007 (10:31 am)
Disclaimer: "Havent actually tried it and Don't really know(tm)"-advice

TX has the "MountForce"-feature that allows you to loosely mount objects to others. The way it works is that you specify the number of seconds it takes for the Mountee to catch up. It works great in some instances, but isn't very configurable in case you'd want something else. What I don't know if it would work with the camera.

Matias
#6
05/24/2007 (8:02 am)
Yes, MountForce works with the camera. :)