<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3ANifDisplaySetTranslation</id>
	<title>API:NifDisplaySetTranslation - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3ANifDisplaySetTranslation"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:NifDisplaySetTranslation&amp;action=history"/>
	<updated>2026-10-17T17:54:16Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.returnofreckoning.com/index.php?title=API:NifDisplaySetTranslation&amp;diff=30617&amp;oldid=prev</id>
		<title>Maintenance script: UI Lua API import (WAR 1.4.8)</title>
		<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:NifDisplaySetTranslation&amp;diff=30617&amp;oldid=prev"/>
		<updated>2026-10-16T19:47:25Z</updated>

		<summary type="html">&lt;p&gt;UI Lua API import (WAR 1.4.8)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{LuaApi|group=Interface}}&lt;br /&gt;
Sets the translation (position offset) of the 3D model shown in a NifDisplay window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NifDisplaySetTranslation(windowName, x, y, z)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
;windowName : &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; – Name of a NifDisplay window.&lt;br /&gt;
;x, y, z : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – The translation along the three axes.&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
Nothing.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* The three values are stored as the display&amp;#039;s translation. They are not range-checked.&lt;br /&gt;
* The stock barber shop uses it to adjust the character shown in its &amp;quot;mirror&amp;quot;, with different values for tall and short races (see the example). Its comment for orcs reads &amp;#039;&amp;#039;&amp;quot;need camera further back&amp;quot;&amp;#039;&amp;#039;.&lt;br /&gt;
* The stock UI does not call it anywhere else.&lt;br /&gt;
* The function needs at least four arguments and only reads the last four.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
These are written to the UI log; the call returns normally.&lt;br /&gt;
* &amp;lt;code&amp;gt;Error in function call &amp;#039;NifDisplaySetTranslation&amp;#039;: Window %s does not exist&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;Error in function call &amp;#039;NifDisplaySetTranslation&amp;#039;: Window %s is not a NifDisplay&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
From &amp;lt;code&amp;gt;ea_barbershopwindow/source/barbershopwindow.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
-- For some characters, we need to tweak the NifDisplay to make sure they show up in the mirror appropriately&lt;br /&gt;
if ( ( ( GameData.Player.race.id == GameData.Races.HIGH_ELF ) or ( GameData.Player.race.id == GameData.Races.DARK_ELF ) ) and ( GameData.Player.gender == GameData.Gender.MALE ) )&lt;br /&gt;
then&lt;br /&gt;
    -- Male high elves and dark elves are very tall&lt;br /&gt;
    NifDisplaySetTranslation( mainWindowName..&amp;quot;CharacterNif&amp;quot;, 0, -80, 66 )&lt;br /&gt;
...&lt;br /&gt;
elseif ( GameData.Player.race.id == GameData.Races.DWARF )&lt;br /&gt;
then&lt;br /&gt;
    -- Dwarves are very short&lt;br /&gt;
    NifDisplaySetTranslation( mainWindowName..&amp;quot;CharacterNif&amp;quot;, 0, -110, 37 )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:WindowSetDimensions|WindowSetDimensions]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>