Jump to content

Recommended Posts

Posted

Hi all,

 

I'm currently trying to modify the camera jiggle in Config/View/View.lua so that I can get a realistic camera movement (as in, someone standing and holding a camera on the ground) in free view (F11) similar to what you see in this video:

Unfortunately I am having trouble understanding what all of the variables refer to. Here's what my config currently reads (changes highlighted in red):

 

function CameraJiggle(t,rnd1,rnd2,rnd3)
local rotX, rotY, rotZ
rotX = 0.05 * rnd1 * math.sin(37.0 * (t - 0.0))
rotY = 0.05 * rnd2 * math.sin(41.0 * (t - 1.0))
rotZ = 0.05 * rnd3 * math.sin(53.0 * (t - 2.0))
[color="red"]--rotX = rotX * 0.1;
--rotY = rotY * 0.1;
--rotZ = rotZ * 0.1;[/color]
return rotX, rotY, rotZ
end

function CameraFloat(t)
local dX, dY, dZ
[color="red"]--[/color]dX = 0.61 * math.sin(0.7 * t) + 0.047 * math.sin(1.6 * t);
[color="red"]--[/color]dY = 0.43 * math.sin(0.6 * t) + 0.067 * math.sin(1.7 * t);
[color="red"]--[/color]dZ = 0.53 * math.sin(1.0 * t) + 0.083 * math.sin(1.9 * t);
[color="Red"]dZ = 0;
dY = 0;
dZ = 0;[/color]
return dX, dY, dZ
end

 

Now, I've simply edited CameraFloat() so that each of the variables is set to zero so that the camera doesn't swing around - after all, if I'm trying to simulate a guy standing there with a camera then I doubt he's going to be doing much running!

 

In CameraJiggle(), you can see I've made an attempt to reduce the effect in the commented out section, by simply multiplying the output on rotX, rotY and rotZ by 0.1 (or dividing by 10, if you'd prefer) and what I THINK is happening is that the overall movement is reduced, so the camera still flicks around rapidly, but it doesn't go quite as far left, right, up, down, forwards and backwards. However, what I initially want to do is reduce the speed of the oscillation, but without knowing exactly what variable means what, I'm not sure where to start.

 

CameraJiggle() takes four arguments; t, rnd1, rnd2 and rnd3, which if I had to guess would mean time, and perhaps the current position of X, Y and Z respectively.

 

Any ideas on how I could adjust the 'speed' and indeed if there are any other existing algorithms out there that could perhaps be modified to suit this function?

 

Apologies if I haven't explained it as clearly as I'd hoped! I'd be happy to provide more information if needed.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...