Fluid Camera Movement
by Jeremy Alessi · in Torque Game Engine · 07/28/2005 (4:47 pm) · 12 replies
There are many camera mods and from what I've seen nothing does exactly what I want. What I'm mainly looking for is a slight mod to the current behind the back camera. In Blitz3D it'd be something simple like this:
The 'True' in the EntityXYZ calls mean that you are returning the world coordinate, not it's local space coordinate.
Right now Torque always positions the camera directly on the pivot which creates a very rigid look ... we want to get away from that and give it more flow as we did with Aerial Antics.
It looks like perhaps this could be done in player.cc maybe ... but it's not really apparent to me right off the bat. Any help would be much appreciated.
The 'True' in the EntityXYZ calls mean that you are returning the world coordinate, not it's local space coordinate.
dx# = EntityX( cameraPivot, True ) - EntityX( camera ) // Distance along X dy# = EntityY( cameraPivot, True ) - EntityY( camera ) // Distance along Y dz# = EntityZ( cameraPivot, True ) - EntityZ( camera ) // Distance along Z PositionEntity(cameraPivot, 0, 10, -20) //Positions the pivot relative to it's parent, in this case it's a WAY behind the back view and up in the air a bit (different coordinate system than Torque) TranslateEntity(camera, dx# * .1, dy# * .1 , dz# * .1) //Translates the camera a fraction of the distance between it and the cameraPivot in worldspace, creates a more cinematic camera, instead of a character attached to a stick feel
Right now Torque always positions the camera directly on the pivot which creates a very rigid look ... we want to get away from that and give it more flow as we did with Aerial Antics.
It looks like perhaps this could be done in player.cc maybe ... but it's not really apparent to me right off the bat. Any help would be much appreciated.
About the author
#2
I think that the impression that vehicles give would be very much improved by having a better chase cam... They don't look half bad from a stand alone camera, but when you're in chase mode, somehow, everything feels wrong. I blame the camera, myself. Is there a big improvement from going to a different camera scheme?
07/28/2005 (11:52 pm)
Thanks for following up on this post, Jeremy. It's really good to see people posting answers to their own questions (even if they got a little help on finding the answer - thanks for the kind mention :).I think that the impression that vehicles give would be very much improved by having a better chase cam... They don't look half bad from a stand alone camera, but when you're in chase mode, somehow, everything feels wrong. I blame the camera, myself. Is there a big improvement from going to a different camera scheme?
#3
07/29/2005 (4:31 pm)
I'm actually using the fluid camera for 3rd person behind a character view. I think it's much improved ... the character on a stick feeling that stock Torque makes the whole thing feel very inorganic. I originally had a camera just like it for Aerial Antics too and I also changed that over to a 'soft' camera which gave the game a lot more character.
#4
08/02/2005 (5:38 pm)
Can you post this on a tutorial or where you edited your files? itd be really helpful. im in the middle of changing my player.cc and lookin at vehicle.cc
#5
08/03/2005 (4:27 am)
Yes. I too would be quite interested in implementing this.
#6
08/03/2005 (4:38 am)
This is something that has been bugging me also.
#7
Keep in mind, you are storing the actual transform, not the rendered transform.
08/03/2005 (5:23 am)
Well, off the top of my head... Store the last x camera transforms and set the rendered camera transform to be the average of the last x transforms...Keep in mind, you are storing the actual transform, not the rendered transform.
#8
If it works like the vehicle camera does, you can simply select the options you want by defining values for them in the datablock.
What I mean is, if you don't want the camera to "lag" behind the player, just omit the variable that controls that behavior and it forces the camera to behave more rigidly. If you want it, just declare the value you want and voila.
Seems useful enough to me to be included in the core engine?!
08/03/2005 (7:07 am)
Why not just roll this into head.If it works like the vehicle camera does, you can simply select the options you want by defining values for them in the datablock.
What I mean is, if you don't want the camera to "lag" behind the player, just omit the variable that controls that behavior and it forces the camera to behave more rigidly. If you want it, just declare the value you want and voila.
Seems useful enough to me to be included in the core engine?!
#9
08/03/2005 (7:50 am)
Yes, but it adds overhead :)
#10
08/03/2005 (2:28 pm)
Added the resource.
#11
08/03/2005 (4:44 pm)
It's a great resource (just approved it). It might go into HEAD at some point but probably not right now.
#12
08/03/2005 (5:48 pm)
Thanks, that'd be awesome!
Torque Owner Jeremy Alessi