Search In
• More options...
Find results that contain...
Find results in...

# Spline Camera

## Recommended Posts

I'm currently working with spline cameras.

I didn't found a lot of them in this forum and I'd like to share what I've learned so far.

camera: (p0)

handle of camera setup with "DEFAULT_SPLINE_CAMERA", (other cam type won't crash the game, they can't be influenced by using nodes)

x,y,z: (p1, p2, p3)

coordinates of the camera, nothing special

xRot, yRot, zRot: (p4, p5, p6)

The first parameter is the pitch (up/down), the second is yaw (right/left) and the last one is roll (rotate around view axis)

These values are in degree and the rotations are applied in this order (p4 -> p5 -> p6)

p7: (p7)

Indirectly determines the percentage of a transition between two nodes. (Imo you can see it as length of the spline between two nodes)

Clearly changes the path of the spline.

Example:

Node0: (..., p7 = x,...)

Node1: (..., p7 = a,...)

Node2: (..., p7 = b,...)

- x doesn't change anything in my test code, but this seems clear since it would describe the transition from Node-1 which doesn't exist

- a=b=c: at 0.5 of the spline phase, Node1 is reached.

- a=4*b: at 0.8 of the spline phase, Node1 is reached

p8: (p8)

Big values (>>1) will deaccelerate the movement before the specific node is reached.

Behaves a little bit like slowing down at the end of the spline.

Note: The movement to the next node, doesn't start slow.

p9: (p9)

No idea what this value acctually does. Any value different from 0 apparantly ovverides the pitch/rotX and the camera axis is showing towards the horizon. (?)

Something I tested as well:

Adding nodes while the spline phase is between 0 and 1 won't change the spline phase.

Example:

Create a cam, add 3 nodes (p7=1), wait until the second node is reached (spline phase = 0.5), then add t2o more nodes (p7 = 1 too).

This doesn't set the spline phase back to 0.25 which would be the proper phase at the second node now.

But jumps directly to the third node which proper spline phase is now 0.5 instead of 1.0.

Node: 1 2 3 4 5

Phase: 0.0 0.5 1.0

0.0 0.25 0.5 0.75 1.0

My conclusion is that you should setup all nodes at once to avoid this jump.

Or set the spline phase back (0.25 in this example) if the nodes are unkown at the beginning, but this requires knowledge about the p7 values of the nodes before.

Questions remaining:

-changing a node will change the spline between the nodes before/after, how far?

-is there an efficient way to use them dynamically or are they only useable for e.g. showing a location in a cutscene with predefined nodes

-how does OVERRIDE_SPLINE_VELOCITY work exactly? (parameters?)

Edited by LeFix

##### Share on other sites

Is there any advantage of using these natives instead of interpolating position & rotation yourself in a tick?

##### Share on other sites

Is there any advantage of using these natives instead of interpolating position & rotation yourself in a tick?

The definition of a comparable camera movement is much shorter with a spline camera and really smooth, but as I said I only use it for static things like showing buildings or achieving a panorama view, for thing like following vehicles I'm using simple interpolations as well.

Edited by LeFix

##### Share on other sites

Is there any advantage of using these natives instead of interpolating position & rotation yourself in a tick?

The definition of a comparable camera movement is much shorter with a spline camera and really smooth, but as I said I only use it for static things like showing buildings or achieving a panorama view, for thing like following vehicles I'm using simple interpolations as well.

Gotta agree on that it's shorter, but once you made a class you can just copy+paste it. And you can make it as smooth as you want with easing equations.

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×