<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.sasgaming.net/index.php?action=history&amp;feed=atom&amp;title=Minecraft%3AProcedural_animated_texture_generation%2FCompasses</id>
	<title>Minecraft:Procedural animated texture generation/Compasses - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.sasgaming.net/index.php?action=history&amp;feed=atom&amp;title=Minecraft%3AProcedural_animated_texture_generation%2FCompasses"/>
	<link rel="alternate" type="text/html" href="https://wiki.sasgaming.net/index.php?title=Minecraft:Procedural_animated_texture_generation/Compasses&amp;action=history"/>
	<updated>2026-04-21T04:04:37Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://wiki.sasgaming.net/index.php?title=Minecraft:Procedural_animated_texture_generation/Compasses&amp;diff=91901&amp;oldid=prev</id>
		<title>SyncBot: Sync: new page from Minecraft</title>
		<link rel="alternate" type="text/html" href="https://wiki.sasgaming.net/index.php?title=Minecraft:Procedural_animated_texture_generation/Compasses&amp;diff=91901&amp;oldid=prev"/>
		<updated>2026-04-18T11:14:54Z</updated>

		<summary type="html">&lt;p&gt;Sync: new page from Minecraft&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;includeonly&amp;gt;{{exclusive|java|console|section=1}}&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;{{outdated|Procedurally generated textures such as this one were removed and replaced by pre-rendered animations in [[Minecraft:Java Edition 1.5]] and [[Minecraft:Xbox 360 Edition TU12]].}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compasses simply draw two lines over the item sprite to form the needle.&lt;br /&gt;
&lt;br /&gt;
Much like clocks, the code responsible for moving the needle is also present with the &amp;quot;setup&amp;quot; code, however it is omitted here as it is not pertinent to the actual drawing of the sprite. Also like clocks, an oversight in how the compass sprite is set to be loaded prevents texture packs from overriding the compass&amp;#039;s base sprite.&lt;br /&gt;
&amp;lt;gallery style=&amp;quot;text-align:center&amp;quot;&amp;gt;&lt;br /&gt;
Compass (texture) JE1 BE1.png|The base sprite for the compass&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python3&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
def setup_compass_sprite (item: Image, angle: float, output: Image):&lt;br /&gt;
	NX      = 8.5&lt;br /&gt;
	NY      = 7.5&lt;br /&gt;
	SCALE_X = 0.3&lt;br /&gt;
	SCALE_Y = SCALE_X * 0.5&lt;br /&gt;
	&lt;br /&gt;
	# copy the item&amp;#039;s texture into the output&lt;br /&gt;
	for i, pix in enumerate(item):&lt;br /&gt;
		output.set_pixeli(i, pix)&lt;br /&gt;
	&lt;br /&gt;
	rx = sin(angle)&lt;br /&gt;
	ry = cos(angle)&lt;br /&gt;
	&lt;br /&gt;
	# draw the smaller horizontal spurs of the needle&lt;br /&gt;
	# 1 is added to the endpoint, as `range` here is&lt;br /&gt;
	# end-exclusive. The original loops did `i &amp;lt;= 4`&lt;br /&gt;
	for i in range(-4, 4 + 1):&lt;br /&gt;
		x = int(NX + ry * i * SCALE_X)&lt;br /&gt;
		y = int(NY - rx * i * SCALE_Y)&lt;br /&gt;
		output.set_pixel(x, y, &amp;#039;#646464&amp;#039;)&lt;br /&gt;
	&lt;br /&gt;
	# draw the main part needle&lt;br /&gt;
	for i in range(-8, 16 + 1):&lt;br /&gt;
		x = int(NX + rx * i * SCALE_X)&lt;br /&gt;
		y = int(NY + ry * i * SCALE_Y)&lt;br /&gt;
		if i &amp;gt;= 0:&lt;br /&gt;
			# Main red pointer&lt;br /&gt;
			output.set_pixel(x, y, &amp;#039;#FF1414&amp;#039;)&lt;br /&gt;
		else:&lt;br /&gt;
			# Grey back half&lt;br /&gt;
			output.set_pixel(x, y, &amp;#039;#646464&amp;#039;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The generated compass sprite has 102 possible unique frames, while the pre-rendered compass has significantly less, at only 32 frames.&lt;br /&gt;
&amp;lt;gallery style=&amp;quot;text-align:center&amp;quot;&amp;gt;&lt;br /&gt;
Compass JE1.gif|Procedurally generated&lt;br /&gt;
Compass JE2 BE2.gif|Pre-rendered frames&lt;br /&gt;
Compass Proctex Needle Points.gif|Visualization of all of the points that are plotted in drawing the needle&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category: Textures]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>SyncBot</name></author>
	</entry>
</feed>