mirror of
https://github.com/gomson/TimothyLottes.github.io.git
synced 2026-08-04 14:48:49 +00:00
Add files via upload
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<html><head><link rel="stylesheet" href="style.css"></head><body><div class="page">
|
||||
<h1>20081014 - Octahedron Mapping</h1>
|
||||
<br>
|
||||
|
||||
Often when solving a problem it is necessary to map or project a 3D space into a 2D space for efficient computation. Commonly used mappings are cubemaps, sphere maps, and dual paraboloid maps. Each have different trade offs. The octahedron map is another option. Take the 8 sided octahedron and flatten it into a texture, as in the really poor ASCII art below.
|
||||
<br><br>
|
||||
|
||||
<pre>
|
||||
..3D...........2D...
|
||||
....................
|
||||
...+.........+--+--+
|
||||
../|\........|E/|\F|
|
||||
./A|B\.......|/A|B\|
|
||||
+--+--+..TO..+--+--+
|
||||
.\C|D/.......|\C|D/|
|
||||
..\|/........|G\|/H|
|
||||
...+.........+--+--+
|
||||
|
||||
ABCD -> -z half of octahedron
|
||||
EFGH -> +z half of octahedron
|
||||
|
||||
For 1/8 the coordinates in the unit sphere where x,y,z all > 0,
|
||||
|
||||
s = x / (x+y+z)
|
||||
t = y / (x+y+z)
|
||||
|
||||
And to reverse,
|
||||
|
||||
x = s / (s^2 + t^2 + (1-s-t)^2)^(1/2)
|
||||
y = t / (s^2 + t^2 + (1-s-t)^2)^(1/2)
|
||||
z = (1-s-t) / (s^2 + t^2 + (1-s-t)^2)^(1/2)
|
||||
</pre>
|
||||
|
||||
</div></body></html>
|
||||
|
||||
|
||||
@@ -318,6 +318,7 @@ and attempting to restore what I can from prior lost images.
|
||||
<br>
|
||||
<a href="20081030.html">20081030 - Parallel Rapid Development Architecture</a><br>
|
||||
<a href="20081020.html">20081020 - Temporal Binned Ring Buffers</a><br>
|
||||
<a href="20081014.html">20081014 - Octahedron Mapping</a><br>
|
||||
<br>
|
||||
<b>2007</b><br>
|
||||
<a href="20071026.html">20071026 - Transform Feedback</a><br>
|
||||
|
||||
Reference in New Issue
Block a user