Page 1 of 1
AddCameraShot() Research
Posted: Tue Jul 01, 2014 8:26 pm
by Marth8880
Hey guys. I was playing around with the
AddCameraShot values earlier today and I found out some things that I thought would be convenient to post.
_____________________________________________
Function layout:
AddCameraShot(rotate_y, rotate_z, UNKNOWN, rotate_x, position_x, position_y, position_z
)
The rotate values are most likely in radians (instead of degrees - i.e., the value can range from -1.0 to 1.0) and the position values are most likely individual grid units (or possibly quarters of them) in Zero Editor with the center - 0,0,0 - being the very center of the grid.
Example code with comments:
Code: Select all
-- Information: rot_y rot_z unknown rot_x pos_x pos_y pos_z
AddCameraShot(0.327342, 0.011198, -0.944287, 0.032303, -74.878967, 5.497213, -69.507790); -- tram station
Notes regarding 'UNKNOWN':
The unknown value is...weird. Here's a snippet of a conversation regarding it (in
italics) between me and AQT:
Re: AddCameraShot() Research
Posted: Tue Jul 01, 2014 9:13 pm
by GAB
Maybe the UNKNOWN value is a zoom of some sort.
Re: AddCameraShot() Research
Posted: Tue Jul 01, 2014 9:33 pm
by Marth8880
That's what AQT and I originally thought, but it seems to rotate the camera diagonally in a weird way without any sort of zoom.

Re: AddCameraShot() Research
Posted: Tue Jul 01, 2014 9:35 pm
by Teancum
GAB wrote:Maybe the UNKNOWN value is a zoom of some sort.
Or an FOV change?
Re: AddCameraShot() Research
Posted: Tue Jul 01, 2014 9:53 pm
by Marth8880
Teancum wrote:GAB wrote:Maybe the UNKNOWN value is a zoom of some sort.
Or an FOV change?
Possibly, but not likely, considering the value's range seems to be -1.0 to 1.0 like with the rotation values, though one could somewhat argue that the maximum (1.0) and minimum (-1.0) field of view "final" values are hardcoded. It would be a weird thing to hardcode, though. Also, judging from my tests, the camera's actual field of view never appeared to change, but rather the rotation of the camera did instead.

Re: AddCameraShot() Research
Posted: Wed Jul 02, 2014 8:22 am
by AnthonyBF2
you can use the debug executable and use free cam, use the command thing and type "dumpcamera" to print coordinates. they are saved in a text file in the gamedata folder.
hope this helps (sounds like you were editing the numbers manually in map script)
Re: AddCameraShot() Research
Posted: Wed Jul 02, 2014 9:10 am
by AQT
anthonybf2 wrote:sounds like you were editing the numbers manually in map script
...to find out what each value does.
Re: AddCameraShot() Research
Posted: Wed Jul 02, 2014 3:38 pm
by LRKfm946
You could also try changing the camera shot in real time via LUA in the debug console (SetCameraPosition, etc.). I'm not sure if any of those functions will have all the parameters you want though.
Re: AddCameraShot() Research
Posted: Wed Jul 02, 2014 8:38 pm
by AceMastermind
The rotation values being displayed are likely quaternions.
Re: AddCameraShot() Research
Posted: Wed Jul 02, 2014 9:38 pm
by Maveritchell
I can't find my notes on this (I used to have some of this commented on in a test script; I'll update this if I can dig it up), but an easier way to test this is going to be with CreateMatrix(), which uses the same inputs. You'll be able to examine position and rotation much easier (and externally) that way.
Re: AddCameraShot() Research
Posted: Wed Jul 02, 2014 10:07 pm
by Marth8880
AceMastermind wrote:The rotation values being displayed are likely quaternions.
That would make a lot more sense, especially considering quaternions consist of four values/dimensions (or something like that).
Maveritchell wrote:I can't find my notes on this (I used to have some of this commented on in a test script; I'll update this if I can dig it up), but an easier way to test this is going to be with CreateMatrix(), which uses the same inputs. You'll be able to examine position and rotation much easier (and externally) that way.
Notes would be great.

I'll also try to mess around with CreateMatrix().