Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: prometh on November 29, 2009, 01:59:09 pm

Title: Head-bobbing camera in cockpit view
Post by: prometh on November 29, 2009, 01:59:09 pm
The camera currently shakes when the ship is hit, etc... but what about sharp movements? I think the head should kinda bob

The only thing I'm not totally sure of is whether this would even happen in 0 gravity.

But, putting in such a feature would be great for a possible future addition of planetary missions
Title: Re: Head-bobbing camera in cockpit view
Post by: The E on November 29, 2009, 02:00:22 pm
Use TrackIR. Provide your own head movement.

That being said, something like that could probably be scripted in.
Title: Re: Head-bobbing camera in cockpit view
Post by: prometh on November 29, 2009, 02:19:44 pm
Sure, TrackIR is good... but if the ship's been hit, even TrackIR should be forced into an "inaccurate mode". No one's head can move perfectly when their chair is shaking :)
Title: Re: Head-bobbing camera in cockpit view
Post by: Nuke on December 06, 2009, 04:48:45 am
it could probibly be done with scripting. kinda have the view camera slew slightly in response to changes in velocity, rotation rate, impacts. it essentially boils down to "shake the camera". another thing to add to my cockpit scripts.
Title: Re: Head-bobbing camera in cockpit view
Post by: Cobra on December 09, 2009, 01:16:40 pm
Sure, TrackIR is good... but if the ship's been hit, even TrackIR should be forced into an "inaccurate mode". No one's head can move perfectly when their chair is shaking :)

Call Swifty then and see if he'll do something like that. :P
Title: Re: Head-bobbing camera in cockpit view
Post by: Nuke on December 09, 2009, 10:07:25 pm
i dont think it should be a track-ir effect only. trackir is just a stand in for other view controls. camera has its own orientation and position, which is multiplied and added, respectively, to the view orientation and position. to do "wiggle cam" you need to compute an orientation matrix and position to represent the wiggle, then multiply and add it to the modified camera orientation and position. to simulate g forces you would need to compute angular and linear accelerations multiplied by some control scaler (to diminish/enhance the effect to make it look right). if theres an inpact, we add a distortion to those values. then we build a matrix and position (seriously why doesnt freespace use 4x4 matrices yet) which is multiplied and added to the camera orientation and position.
Title: Re: Head-bobbing camera in cockpit view
Post by: chief1983 on December 11, 2009, 07:10:46 pm
I don't think he's saying it should be TrackIR but it would be in a similar area of code probably, and would also have to work with TrackIR.
Title: Re: Head-bobbing camera in cockpit view
Post by: Nuke on December 12, 2009, 12:57:53 am
im not sure if youd want to apply the effect before or after view modifications. but yea it would probibly go into that part of the code, if done in c.