<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/wiki/HU/setCameraMatrix?action=history&amp;feed=atom</id>
	<title>HU/setCameraMatrix - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/wiki/HU/setCameraMatrix?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=HU/setCameraMatrix&amp;action=history"/>
	<updated>2026-10-24T06:51:50Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.1</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=HU/setCameraMatrix&amp;diff=63717&amp;oldid=prev</id>
		<title>Surge at 10:33, 11 August 2019</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=HU/setCameraMatrix&amp;diff=63717&amp;oldid=prev"/>
		<updated>2019-08-11T10:33:53Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 10:33, 11 August 2019&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l3&quot;&gt;Line 3:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 3:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This function sets the camera&amp;#039;s position and direction. The first three arguments are the point at which the camera lies, the last three are the point the camera faces (or the point it &amp;quot;looks at&amp;quot;).&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This function sets the camera&amp;#039;s position and direction. The first three arguments are the point at which the camera lies, the last three are the point the camera faces (or the point it &amp;quot;looks at&amp;quot;).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039;&lt;/del&gt;Note&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;:&#039;&#039;&#039; &lt;/del&gt;Calling this function takes the camera&#039;s focus away from the player and sets the camera in a fixed position and rotation. The camera&#039;s focus can be brought back to the player using the [[setCameraTarget]] function.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{&lt;/ins&gt;Note&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|&lt;/ins&gt;Calling this function takes the camera&#039;s focus away from the player and sets the camera in a fixed position and rotation. The camera&#039;s focus can be brought back to the player using the [[setCameraTarget]] function.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Syntax==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Syntax==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki-wiki_dev_:diff:1.41:old-58564:rev-63717:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Surge</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=HU/setCameraMatrix&amp;diff=58564&amp;oldid=prev</id>
		<title>Surge: Created page with &quot;__NOTOC__ {{Server client function}} This function sets the camera&#039;s position and direction. The first three arguments are the point at which the camera lies, the last three a...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=HU/setCameraMatrix&amp;diff=58564&amp;oldid=prev"/>
		<updated>2018-08-26T15:29:25Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;__NOTOC__ {{Server client function}} This function sets the camera&amp;#039;s position and direction. The first three arguments are the point at which the camera lies, the last three a...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function sets the camera&amp;#039;s position and direction. The first three arguments are the point at which the camera lies, the last three are the point the camera faces (or the point it &amp;quot;looks at&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; Calling this function takes the camera&amp;#039;s focus away from the player and sets the camera in a fixed position and rotation. The camera&amp;#039;s focus can be brought back to the player using the [[setCameraTarget]] function.&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setCameraMatrix ( player thePlayer, float positionX, float positionY, float positionZ [, float lookAtX, float lookAtY, float lookAtZ, float roll = 0, float fov = 70 ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[player]]:setCameraMatrix|cameraMatrix|getCameraMatrix}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;thePlayer:&amp;#039;&amp;#039;&amp;#039; The player whose camera is to be changed.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;positionX:&amp;#039;&amp;#039;&amp;#039; The x coordinate of the camera&amp;#039;s position.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;positionY:&amp;#039;&amp;#039;&amp;#039; The y coordinate of the camera&amp;#039;s position.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;positionZ:&amp;#039;&amp;#039;&amp;#039; The z coordinate of the camera&amp;#039;s position.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;{{New feature/item|3.0141|1.4.1|7005|Instead of six coordinates, or two vectors, a Matrix can be supplied.}}&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;lookAtX:&amp;#039;&amp;#039;&amp;#039; The x coordinate of the point the camera faces.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;lookAtY:&amp;#039;&amp;#039;&amp;#039; The y coordinate of the point the camera faces.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;lookAtZ:&amp;#039;&amp;#039;&amp;#039; The z coordinate of the point the camera faces.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;roll:&amp;#039;&amp;#039;&amp;#039; The camera roll angle, -180 to 180. A value of 0 means the camera sits straight, positive values will turn it counter-clockwise and negative values will turn it clockwise. -180 or 180 means the camera is upside down.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;fov:&amp;#039;&amp;#039;&amp;#039; the field of view angle, 0.01 to 180. The higher this value is, the more you will be able to see what is to your sides.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setCameraMatrix ( float positionX, float positionY, float positionZ [, float lookAtX, float lookAtY, float lookAtZ, float roll = 0, float fov = 70 ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP|This is under the static class &amp;#039;&amp;#039;&amp;#039;Camera&amp;#039;&amp;#039;&amp;#039;|Camera.setMatrix|matrix|getCameraMatrix}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;positionX:&amp;#039;&amp;#039;&amp;#039; The x coordinate of the camera&amp;#039;s position.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;positionY:&amp;#039;&amp;#039;&amp;#039; The y coordinate of the camera&amp;#039;s position.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;positionZ:&amp;#039;&amp;#039;&amp;#039; The z coordinate of the camera&amp;#039;s position.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;{{New feature/item|3.0141|1.4.1|7005|Instead of six coordinates, or two vectors, a Matrix can be supplied.}}&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;lookAtX:&amp;#039;&amp;#039;&amp;#039; The x coordinate of the point the camera faces.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;lookAtY:&amp;#039;&amp;#039;&amp;#039; The y coordinate of the point the camera faces.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;lookAtZ:&amp;#039;&amp;#039;&amp;#039; The z coordinate of the point the camera faces.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;roll:&amp;#039;&amp;#039;&amp;#039; The camera roll angle, -180 to 180. A value of 0 means the camera sits straight, positive values will turn it counter-clockwise and negative values will turn it clockwise. -180 or 180 means the camera is upside down.&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;fov:&amp;#039;&amp;#039;&amp;#039; the field of view angle, 0.01 to 180. The higher this value is, the more you will be able to see what is to your sides.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns &amp;#039;&amp;#039;true&amp;#039;&amp;#039; if the arguments are valid, &amp;#039;&amp;#039;false&amp;#039;&amp;#039; otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This code fixates the camera onto the Vinewood sign in Los Santos for any player that joins the server:&lt;br /&gt;
&amp;lt;section class=&amp;quot;server&amp;quot; name=&amp;quot;Server script&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function setCameraOnPlayerJoin()&lt;br /&gt;
     -- slowly fade the camera in to make the screen visible&lt;br /&gt;
     fadeCamera(source, true, 5)&lt;br /&gt;
     -- set the player&amp;#039;s camera to a fixed position, looking at a fixed point&lt;br /&gt;
     setCameraMatrix(source, 1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerJoin&amp;quot;, root, setCameraOnPlayerJoin)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client camera functions hu}}&lt;br /&gt;
&lt;br /&gt;
[[en:setCameraMatrix]]&lt;/div&gt;</summary>
		<author><name>Surge</name></author>
	</entry>
</feed>