Re: Frame independent Camera Shake

Jason Hughes <[email protected]>
Newsgroups gmane.games.devel.algorithms
Organization Steel Penny Games, Inc.
Message-ID <[email protected]>
Camera shake is inherently tied to frame rate.  A shake that looks good 
at 20hz will not necessarily be impressive at 30hz.  Even so, if you 
make sure the shake occurs according to delta-time rather than a fixed 
step per frame, that's at least going in the right direction.  For very 
low framerates, you may lose all sense of shake at all, just because the 
frequency of the shake is a multiple of the frequency of the frames!  
Nothing much you can do there.

If you have that problem, the best I can suggest is try using a 
translation-based, non-periodic shake, rather than a rotationally-based 
one.  The benefit of that is, you get the same sensation of shake 
regardless of the scale of your scene (rotation affects distant objects 
more, obviously), and non-periodic prevents you from losing the shaking 
sensation just because your framerate varies or drops.  Eg. camTrans = 
vector.random() * scale

On Wing Commander: Prophecy (or was it WC4?) I put in a camera shake 
that was framerate independent in different way... when you got hit, I 
computed an axis and angle based on where the shot contacted your ship 
and how much damage you had taken, then rotated the camera (for both the 
HUD and the 3D scene) + on even frames, - on odd frames, and lerped the 
angle down toward zero over time.  This gave a kind of drunken-image 
that worked at high or low frame rates.

Two different approaches, two different situations.

Best,
JH

Jason Hughes
President
Steel Penny Games, Inc.
Austin, TX



Amir H. Fassihi wrote:
> Hello everyone,
>
> I am trying to implement a camera shake feature and I was wondering 
> what a robust and standard technique for it could be.
> Currently I am using this formula : value = a * sin(nx)/mx; to come up 
> with the displacement necessary for the camera node in time, however, 
> variable frame rates can cause the final result to behave differently.
>
> I was wondering what other developers do for implementing camera shakes.
>
> Regards,
>
> Amir
>
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> This SF.Net email is sponsored by the Verizon Developer Community
> Take advantage of Verizon's best-in-class app development support
> A streamlined, 14 day to market process makes app distribution fast and easy
> Join now and get one step closer to millions of Verizon customers
> http://p.sf.net/sfu/verizon-dev2dev 
> ------------------------------------------------------------------------
>
> _______________________________________________
> GDAlgorithms-list mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list
> Archives:
> http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev

_______________________________________________
GDAlgorithms-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.