Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
      4. Frontier Pursuits
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. DLC
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
      7. The Diamond Casino Heist
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA IV Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA SA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA VC Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA III Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. News

    2. Forum Support

    3. Site Suggestions

LeFix

Spline Camera

Recommended Posts

LeFix

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.

 

Please correct me if I'm wrong and add your experiences.

 

edit.png void ADD_CAM_SPLINE_NODE(int camera, float x, float y, float z, float xRot, float yRot, float zRot, int p7, int p8, int p9) // 8609C75EC438FB3B AD3C7EAA

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
  • Like 1

Share this post


Link to post
Share on other sites
Guad

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

Share this post


Link to post
Share on other sites
LeFix

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 this post


Link to post
Share on other sites
Guad

 

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.

Share this post


Link to post
Share on other sites

Join the conversation

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

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

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


  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.