Handheld style camera movement?

Posted By: jaknine

Handheld style camera movement? - 06/30/08 19:16

Does anyone know of existing code that would add a smooth random movement to a free camera?

Think of any scene in a movie where the camera is handheld and the (very) subtle movement that results. Basically a smooth movement from random point to random point. Is there any code out there already that does this?
Posted By: Orange Brat

Re: Handheld style camera movement? - 07/08/08 00:28

I want to say this was covered once on here a long time ago, but I can't remember exactly when or if it even was. I used to be known as the resident camera guru around here, but I haven't been that active in recent months (I'm here just about everyday, but I don't spend that much time browsing or actively playing with camera code anymore).

I know once upon a time I wanted this, and I still want it. You might try searching the User Contributions forum or one of the scripting forums. There have been massive changes to the forum system over the years, and things get moved around and sometimes posts just disappear, so if there was something here then it may or may not have survived.

Perhaps randomly changing the camera's coordinates within a very small range inside a loop would do it. You'd have to build some internal clamps so the camera position wouldn't go crazy and end up 10 miles from where it started. In other words just move around a fixed point. If the camera can be moved by the player then just save the fixed point where ever the camera ends up once the player stops moving it. It might be a bit trickier whenever the camera is in motion, though.

Oh, and good movie reference would be the newest Rambo. Almost every shot is handheld. It has a very documentary style to it.
Posted By: Joey

Re: Handheld style camera movement? - 07/09/08 19:25

in the gpu gems book there's some sine wave formula for smooth random-looking movement. if you'd apply that on pan, maybe with slight modification, you'll probably get what you want. i'll post the formula later on.
Posted By: jaknine

Re: Handheld style camera movement? - 07/12/08 00:59

Thanks guys.

Joey that would be great if you could post the code.

And Orange_Brat... I saw Rambo the other night and the camera work was awesome. Loved it.
Posted By: Joey

Re: Handheld style camera movement? - 07/13/08 16:00

Code:
cos(x*pi) * cos(x*3*pi) * cos(x*5*pi) * cos(x*7*pi) + sin(x*25*pi) * 0.1


this formula gives you a nice smooth looking animation with not too much repetitance. apply that to pan and tilt and maybe even to its position, maybe with different factors. try replacing some of the numbers by different ones, e.g. cos(x*13*pi) or the like. i think you get the idea.

joey.
Posted By: jaknine

Re: Handheld style camera movement? - 07/15/08 06:44

Originally Posted By: Joey
Code:
cos(x*pi) * cos(x*3*pi) * cos(x*5*pi) * cos(x*7*pi) + sin(x*25*pi) * 0.1


this formula gives you a nice smooth looking animation with not too much repetitance. apply that to pan and tilt and maybe even to its position, maybe with different factors. try replacing some of the numbers by different ones, e.g. cos(x*13*pi) or the like. i think you get the idea.

joey.


Great, thanks, I appreciate it. I'll give it a shot.
Posted By: jaknine

Re: Handheld style camera movement? - 07/15/08 06:45

Originally Posted By: Orange Brat
I used to be known as the resident camera guru around here...


Speaking of that... any chance of getting updated forum links for your Master List? None of the links in it work anymore.
Posted By: Orange Brat

Re: Handheld style camera movement? - 07/15/08 08:17

I've meant to fix that. I did it for the link in my signature, but I'll have to update the thread with corrected links. Thanks for reminding me.


Joey, thanks for the formula. I'll put it to good use.
© 2024 lite-C Forums