Skip to content

Commit

Permalink
Merge pull request #1 from unhyperbolic/insideViewCuspNewApproach
Browse files Browse the repository at this point in the history
Inside view, cusp view: changing from mat_log matrices to Translation…
  • Loading branch information
ckaterba authored Jun 15, 2022
2 parents e6d7cc1 + a8a6ac4 commit 426c021
Showing 1 changed file with 35 additions and 21 deletions.
56 changes: 35 additions & 21 deletions python/raytracing/hyperboloid_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,26 +220,40 @@ def height_euclidean_triangle(z0, z1, z2):

def cusp_view_matrix(tet, subsimplex):

v = tet.R13_vertices[subsimplex] * tet.R13_horosphere_scales[subsimplex]

print(tet.Class[subsimplex].mat_log)

a, b = tet.Class[subsimplex].mat_log[0]
c, d = tet.Class[subsimplex].mat_log[1]
z = (a + b * 1j)
w = (c + d*1j)


RF = v[0].parent()
CF = tet.ShapeParameters[3].parent()

x = matrix([[1.25j*z, -1.25*w],[0,1]], ring = CF)
# Complex numbers encoding translation of horosphere corresponding
# to meridian and longitude. Here, the horosphere maps to the
# boundary of a cusp neighborhood with area one.
m_translation, l_translation = tet.Class[subsimplex].Translations

print(m_translation)
print(l_translation)

CF = m_translation.parent()
RF = m_translation.real().parent()

# Let us work in the upper halfspace model
# H^3 = { z + tj : z in C, t > 0 }
# and with coordinates such that:
# 1. The camera we start with is at jand looking down.
# 2. The above horosphere is horizontal.
# 3. The meridian and longitude act by the PSL(2,Z)-matrix
# [[1, z], [0, 1]] where z = m_translation or z = l_translation,
# respectively.

borel_transform = matrix([[ 1, (m_translation + l_translation) / 2],
[ 0, 1]], ring = CF)

base_camera_matrix = matrix(
[[ 1, 0, 0, 0],
[ 0, 0, 0, 1],
[ 0, 1, 0, 0],
[ 0, 0, 1, 0]], ring = RF)

m = tet.cusp_to_tet_matrices[subsimplex]
# Apply necessary pre and post O13-transforms to the transform
# in the upper halfspace we computed above.
o13_matrix = (
tet.cusp_to_tet_matrices[subsimplex] *
pgl2c_to_o13(borel_transform) *
base_camera_matrix)

m = m * pgl2c_to_o13(x) * matrix([[1,0,0,0],
[0,0,0,1],
[0,1,0,0],
[0,0,1,0]],
ring = RF)
return m
return o13_matrix

0 comments on commit 426c021

Please sign in to comment.